[Redis-benchmark] Support zset type

(cherry picked from commit e6c811cd851cc1b37a0b626458258a26cea0bab3)
This commit is contained in:
ShooterIT 2020-08-06 15:36:28 +08:00 committed by Oran Agra
parent 57c6b0e718
commit e7ce996d8c

View File

@ -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") ||