diff --git a/src/valkey-benchmark.c b/src/valkey-benchmark.c index 284f33b3f8..a033fd0d47 100644 --- a/src/valkey-benchmark.c +++ b/src/valkey-benchmark.c @@ -2320,15 +2320,21 @@ int main(int argc, char **argv) { free(cmd); } + if (test_is_selected("hset")) { + len = valkeyFormatCommand(&cmd, "HSET myhash%s element:__rand_int__ %s", tag, data); + benchmark("HSET", cmd, len); + free(cmd); + } + if (test_is_selected("sadd")) { len = valkeyFormatCommand(&cmd, "SADD myset%s element:__rand_int__", tag); benchmark("SADD", cmd, len); free(cmd); } - if (test_is_selected("hset")) { - len = valkeyFormatCommand(&cmd, "HSET myhash%s element:__rand_int__ %s", tag, data); - benchmark("HSET", cmd, len); + if (test_is_selected("sismember")) { + len = valkeyFormatCommand(&cmd, "SISMEMBER myset%s element:__rand_int__", tag); + benchmark("SISMEMBER", cmd, len); free(cmd); } @@ -2346,6 +2352,19 @@ int main(int argc, char **argv) { free(cmd); } + if (test_is_selected("zscore")) { + len = valkeyFormatCommand(&cmd, "ZSCORE myzset%s element:__rand_1st__", tag); + benchmark("ZSCORE", cmd, len); + free(cmd); + } + + if (test_is_selected("zrange")) { + int score_min = (config.keyspacelen != 0) ? (random() % config.keyspacelen) : 0; + len = valkeyFormatCommand(&cmd, "ZRANGE myzset%s %d +inf BYSCORE LIMIT 0 1", tag, score_min); + benchmark("ZRANGE", cmd, len); + free(cmd); + } + if (test_is_selected("zpopmin")) { len = valkeyFormatCommand(&cmd, "ZPOPMIN myzset%s", tag); benchmark("ZPOPMIN", cmd, len);