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
28a84651
Unverified
Commit
28a84651
authored
Aug 11, 2020
by
Itamar Haber
Committed by
GitHub
Aug 11, 2020
Browse files
Merge pull request #7618 from ShooterIT/benchmark-zset
[Redis-benchmark] Support zset type
parents
5dd499c6
6a06a5a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
28a84651
...
...
@@ -1433,7 +1433,8 @@ usage:
" --cluster Enable cluster mode.
\n
"
" --enable-tracking Send CLIENT TRACKING on before starting benchmark.
\n
"
" -k <boolean> 1=keep alive 0=reconnect (default 1)
\n
"
" -r <keyspacelen> Use random keys for SET/GET/INCR, random values for SADD
\n
"
" -r <keyspacelen> Use random keys for SET/GET/INCR, random values for SADD,
\n
"
" random members and scores for ZADD.
\n
"
" Using this option the benchmark will expand the string __rand_int__
\n
"
" inside an argument with a 12 digits number in the specified range
\n
"
" from 0 to keyspacelen-1. The substitution changes every time a command
\n
"
...
...
@@ -1733,6 +1734,21 @@ int main(int argc, const char **argv) {
free
(
cmd
);
}
if
(
test_is_selected
(
"zadd"
))
{
char
*
score
=
"0"
;
if
(
config
.
randomkeys
)
score
=
"__rand_int__"
;
len
=
redisFormatCommand
(
&
cmd
,
"ZADD myzset:{tag} %s element:__rand_int__"
,
score
);
benchmark
(
"ZADD"
,
cmd
,
len
);
free
(
cmd
);
}
if
(
test_is_selected
(
"zpopmin"
))
{
len
=
redisFormatCommand
(
&
cmd
,
"ZPOPMIN myzset:{tag}"
);
benchmark
(
"ZPOPMIN"
,
cmd
,
len
);
free
(
cmd
);
}
if
(
test_is_selected
(
"lrange"
)
||
test_is_selected
(
"lrange_100"
)
||
test_is_selected
(
"lrange_300"
)
||
...
...
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