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
88015b89
Commit
88015b89
authored
Jan 21, 2013
by
antirez
Browse files
redis-cli --bigkeys output is now simpler to understand.
parent
2039f1a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
88015b89
...
...
@@ -1183,6 +1183,7 @@ static void findBigKeys(void) {
unsigned
long
long
samples
=
0
;
redisReply
*
reply1
,
*
reply2
,
*
reply3
=
NULL
;
char
*
sizecmd
,
*
typename
[]
=
{
"string"
,
"list"
,
"set"
,
"hash"
,
"zset"
};
char
*
typeunit
[]
=
{
"bytes"
,
"items"
,
"members"
,
"fields"
,
"members"
};
int
type
;
printf
(
"
\n
# Press ctrl+c when you have had enough of it... :)
\n
"
);
...
...
@@ -1234,9 +1235,10 @@ static void findBigKeys(void) {
reply3
=
redisCommand
(
context
,
"%s %s"
,
sizecmd
,
reply1
->
str
);
if
(
reply3
&&
reply3
->
type
==
REDIS_REPLY_INTEGER
)
{
if
(
biggest
[
type
]
<
reply3
->
integer
)
{
printf
(
"
[%6s] %s | biggest
so far with
size
%llu
\n
"
,
printf
(
"
Biggest %-6s found
so far
'%s'
with %llu
%s.
\n
"
,
typename
[
type
],
reply1
->
str
,
(
unsigned
long
long
)
reply3
->
integer
);
(
unsigned
long
long
)
reply3
->
integer
,
typeunit
[
type
]);
biggest
[
type
]
=
reply3
->
integer
;
}
}
...
...
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