-
Notifications
You must be signed in to change notification settings - Fork 791
Add --hotkeys-count option for Valkey-cli #1933
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
Add --hotkeys-count option for Valkey-cli #1933
Conversation
34a57b9
to
76987a6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1933 +/- ##
============================================
- Coverage 71.03% 70.82% -0.22%
============================================
Files 123 123
Lines 66037 66049 +12
============================================
- Hits 46911 46780 -131
- Misses 19126 19269 +143
🚀 New features to boost your workflow:
|
I'm not sure "samples" is the right name for this. Samples already means how many keys were checked. The output says
Maybe |
+1 on "hotkeys-count". Changes LGTM overall. We should add documentation too. |
76987a6
to
45a4f0e
Compare
46d45fe
to
8e59e30
Compare
Address the comments, and valkey-doc PR valkey-io/valkey-doc#265 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Just a small comment about the help text.
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
7a66951
to
134b01e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Signed-off-by: Wen Hui <wen.hui.ware@gmail.com>
Every comment is addressed in this PR, and doc PR valkey-io/valkey-doc#265 |
Yes I think you can merge it. Ping approved high level. |
The default value is 16, and if clients use --hotkeys-count as an option, the result will be the specific number of hotkeys. This PR related to PR valkey-io/valkey#1933 --------- Signed-off-by: hwware <wen.hui.ware@gmail.com> Signed-off-by: Wen Hui <wen.hui.ware@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Now we only have --hotkeys option, and the default output value is 16.
This PR add one more option for hotkeys as "--hotkeys-count", users have chance to specific how many output items they want.
Example 1:
./src/valkey-cli --hotkeys-count 10
[00.00%] Hot key '"memtier-3308"' found so far with counter 5
[00.00%] Hot key '"memtier-23516"' found so far with counter 5
[00.00%] Hot key '"memtier-16678"' found so far with counter 5
[00.00%] Hot key '"memtier-25001"' found so far with counter 5
[00.00%] Hot key '"memtier-63829"' found so far with counter 5
[00.00%] Hot key '"memtier-21281"' found so far with counter 5
[00.00%] Hot key '"memtier-81379"' found so far with counter 5
[00.00%] Hot key '"memtier-30335"' found so far with counter 5
[00.00%] Hot key '"memtier-87521"' found so far with counter 5
[00.00%] Hot key '"memtier-42166"' found so far with counter 5
-------- summary -------
Sampled 100000 keys in the keyspace!
hot key found with counter: 5 keyname: "memtier-3308"
hot key found with counter: 5 keyname: "memtier-23516"
hot key found with counter: 5 keyname: "memtier-16678"
hot key found with counter: 5 keyname: "memtier-25001"
hot key found with counter: 5 keyname: "memtier-63829"
hot key found with counter: 5 keyname: "memtier-21281"
hot key found with counter: 5 keyname: "memtier-81379"
hot key found with counter: 5 keyname: "memtier-30335"
hot key found with counter: 5 keyname: "memtier-87521"
hot key found with counter: 5 keyname: "memtier-42166"
Example 2:
./src/valkey-cli --hotkeys-count 20
[00.00%] Hot key '"memtier-3308"' found so far with counter 5
[00.00%] Hot key '"memtier-23516"' found so far with counter 5
[00.00%] Hot key '"memtier-16678"' found so far with counter 5
[00.00%] Hot key '"memtier-25001"' found so far with counter 5
[00.00%] Hot key '"memtier-63829"' found so far with counter 5
[00.00%] Hot key '"memtier-21281"' found so far with counter 5
[00.00%] Hot key '"memtier-81379"' found so far with counter 5
[00.00%] Hot key '"memtier-30335"' found so far with counter 5
[00.00%] Hot key '"memtier-87521"' found so far with counter 5
[00.00%] Hot key '"memtier-42166"' found so far with counter 5
[00.00%] Hot key '"memtier-6370"' found so far with counter 5
[00.01%] Hot key '"memtier-37381"' found so far with counter 5
[00.01%] Hot key '"memtier-95045"' found so far with counter 5
[00.01%] Hot key '"memtier-14027"' found so far with counter 5
[00.01%] Hot key '"memtier-60370"' found so far with counter 5
[00.01%] Hot key '"memtier-98622"' found so far with counter 5
[00.01%] Hot key '"memtier-18642"' found so far with counter 5
[00.01%] Hot key '"memtier-39260"' found so far with counter 5
[00.01%] Hot key '"memtier-64371"' found so far with counter 5
[00.01%] Hot key '"memtier-27099"' found so far with counter 5
-------- summary -------
Sampled 100000 keys in the keyspace!
hot key found with counter: 5 keyname: "memtier-3308"
hot key found with counter: 5 keyname: "memtier-23516"
hot key found with counter: 5 keyname: "memtier-16678"
hot key found with counter: 5 keyname: "memtier-25001"
hot key found with counter: 5 keyname: "memtier-63829"
hot key found with counter: 5 keyname: "memtier-21281"
hot key found with counter: 5 keyname: "memtier-81379"
hot key found with counter: 5 keyname: "memtier-30335"
hot key found with counter: 5 keyname: "memtier-87521"
hot key found with counter: 5 keyname: "memtier-42166"
hot key found with counter: 5 keyname: "memtier-6370"
hot key found with counter: 5 keyname: "memtier-37381"
hot key found with counter: 5 keyname: "memtier-95045"
hot key found with counter: 5 keyname: "memtier-14027"
hot key found with counter: 5 keyname: "memtier-60370"
hot key found with counter: 5 keyname: "memtier-98622"
hot key found with counter: 5 keyname: "memtier-18642"
hot key found with counter: 5 keyname: "memtier-39260"
hot key found with counter: 5 keyname: "memtier-64371"
hot key found with counter: 5 keyname: "memtier-27099"