Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Client Introspection] Client Count Command #1467

Open
wants to merge 13 commits into
base: unstable
Choose a base branch
from

Conversation

sarthakaggarwal97
Copy link
Contributor

With this PR, we would include a new subcommand called CLIENT COUNT.

This subcommand will be responsible for counting the number of clients, while supporting the existing filters and the newly added filters in #1466.

Sample Output:

127.0.0.1:6379> client list
id=8 addr=127.0.0.1:49924 laddr=127.0.0.1:6379 fd=8 name= age=1413 idle=933 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=0 qbuf-free=0 argv-mem=0 multi-mem=0 rbs=1024 rbp=0 obl=0 oll=0 omem=0 tot-mem=1920 events=r cmd=client|count user=default redir=-1 resp=2 lib-name= lib-ver= tot-net-in=380 tot-net-out=217586 tot-cmds=9
id=9 addr=127.0.0.1:49927 laddr=127.0.0.1:6379 fd=9 name= age=1411 idle=0 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=0 qbuf-free=0 argv-mem=10 multi-mem=0 rbs=1024 rbp=0 obl=0 oll=0 omem=0 tot-mem=1946 events=r cmd=client|list user=default redir=-1 resp=2 lib-name= lib-ver= tot-net-in=79 tot-net-out=216501 tot-cmds=2
id=10 addr=127.0.0.1:49928 laddr=127.0.0.1:6379 fd=10 name= age=1409 idle=1409 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=0 qbuf-free=0 argv-mem=0 multi-mem=0 rbs=1024 rbp=0 obl=0 oll=0 omem=0 tot-mem=1920 events=r cmd=command|docs user=default redir=-1 resp=2 lib-name= lib-ver= tot-net-in=27 tot-net-out=215501 tot-cmds=1
127.0.0.1:6379> client count
(integer) 3
127.0.0.1:6379> client count id 8 9
(integer) 2
127.0.0.1:6379> client count id 8 9 addr 127.0.0.1:49927
(integer) 1
127.0.0.1:6379> client count id 8 9 flags N
(integer) 2
127.0.0.1:6379> 

Built on top of: #1401, #1466
Resolves: #668

@sarthakaggarwal97 sarthakaggarwal97 added the needs-doc-pr This change needs to update a documentation page. Remove label once doc PR is open. label Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 86.94779% with 65 lines in your changes missing coverage. Please review.

Project coverage is 70.84%. Comparing base (b56f4f7) to head (e5c4782).
Report is 1 commits behind head on unstable.

Files with missing lines Patch % Lines
src/networking.c 86.94% 65 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1467      +/-   ##
============================================
- Coverage     70.86%   70.84%   -0.03%     
============================================
  Files           119      119              
  Lines         64693    64889     +196     
============================================
+ Hits          45847    45970     +123     
- Misses        18846    18919      +73     
Files with missing lines Coverage Δ
src/commands.def 100.00% <ø> (ø)
src/networking.c 87.73% <86.94%> (-0.90%) ⬇️

... and 11 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-doc-pr This change needs to update a documentation page. Remove label once doc PR is open.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extended Valkey client introspection functionality
1 participant