From b1ad58ed2fada4d7563e91a6834adcee8bffcd82 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 4 Mar 2010 23:05:12 +0100 Subject: [PATCH] redis-benchmark now implements Set commands benchmarks --- redis-benchmark.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/redis-benchmark.c b/redis-benchmark.c index 06057b0de..123d81180 100644 --- a/redis-benchmark.c +++ b/redis-benchmark.c @@ -464,7 +464,7 @@ void parseOptions(int argc, char **argv) { printf(" -n Total number of requests (default 10000)\n"); printf(" -d Data size of SET/GET value in bytes (default 2)\n"); printf(" -k 1=keep alive 0=reconnect (default 1)\n"); - printf(" -r Use random keys for SET/GET/INCR\n"); + printf(" -r Use random keys for SET/GET/INCR, random values for SADD\n"); printf(" Using this option the benchmark will get/set keys\n"); printf(" in the form mykey_rand000000012456 instead of constant\n"); printf(" keys, the argument determines the max\n"); @@ -595,6 +595,24 @@ int main(int argc, char **argv) { aeMain(config.el); endBenchmark("LPOP"); + prepareForBenchmark(); + c = createClient(); + if (!c) exit(1); + c->obuf = sdscat(c->obuf,"SADD myset 24\r\ncounter_rand000000000000\r\n"); + prepareClientForReply(c,REPLY_RETCODE); + createMissingClients(c); + aeMain(config.el); + endBenchmark("SADD"); + + prepareForBenchmark(); + c = createClient(); + if (!c) exit(1); + c->obuf = sdscat(c->obuf,"SPOP myset\r\n"); + prepareClientForReply(c,REPLY_BULK); + createMissingClients(c); + aeMain(config.el); + endBenchmark("SPOP"); + prepareForBenchmark(); c = createClient(); if (!c) exit(1);