Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
7fcf29e6
Commit
7fcf29e6
authored
Aug 06, 2020
by
ShooterIT
Committed by
Oran Agra
Sep 01, 2020
Browse files
[Redis-benchmark] Support zset type
(cherry picked from commit
e5a50ed3
)
parent
e81bac32
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
7fcf29e6
...
...
@@ -1733,6 +1733,22 @@ 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("zrem")) {
len = redisFormatCommand(&cmd,
"ZREM myzset:{tag} element:__rand_int__");
benchmark("ZREM",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