Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
e2a71338
Unverified
Commit
e2a71338
authored
Aug 11, 2020
by
Wagner Francisco Mezaroba
Committed by
GitHub
Aug 11, 2020
Browse files
allow --pattern to be used along with --bigkeys (#3586)
Adds --pattern option to cli's --bigkeys, --hotkeys & --scan modes
parent
82451a47
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
e2a71338
...
...
@@ -1846,7 +1846,8 @@ static void usage(void) {
" --hotkeys Sample Redis keys looking for hot keys.
\n
"
" only works when maxmemory-policy is *lfu.
\n
"
" --scan List all keys using the SCAN command.
\n
"
" --pattern <pat> Useful with --scan to specify a SCAN pattern.
\n
"
" --pattern <pat> Keys pattern when using the --scan, --bigkeys or --hotkeys
\n
"
" options (default: *).
\n
"
" --intrinsic-latency <sec> Run a test to measure intrinsic system latency.
\n
"
" The test will run for the specified amount of seconds.
\n
"
" --eval <file> Send an EVAL command using the Lua script at <file>.
\n
"
...
...
@@ -7275,7 +7276,13 @@ static void pipeMode(void) {
*--------------------------------------------------------------------------- */
static
redisReply
*
sendScan
(
unsigned
long
long
*
it
)
{
redisReply
*
reply
=
redisCommand
(
context
,
"SCAN %llu"
,
*
it
);
redisReply
*
reply
;
if
(
config
.
pattern
)
reply
=
redisCommand
(
context
,
"SCAN %llu MATCH %s"
,
*
it
,
config
.
pattern
);
else
reply
=
redisCommand
(
context
,
"SCAN %llu"
,
*
it
);
/* Handle any error conditions */
if
(
reply
==
NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment