]> git.saurik.com Git - redis.git/commitdiff
Use multi-bulk protocol in SET benchmark
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 5 Nov 2010 09:22:52 +0000 (10:22 +0100)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 5 Nov 2010 09:22:52 +0000 (10:22 +0100)
src/redis-benchmark.c

index 3051e2aec91ae7d5f534df3d86211a700467b565..c44b0ae453cd23b63eaf2dc819eaa27b9fa742e7 100644 (file)
@@ -467,12 +467,13 @@ int main(int argc, char **argv) {
 
         prepareForBenchmark("SET");
         c = createClient(REDIS_REPLY_STATUS);
 
         prepareForBenchmark("SET");
         c = createClient(REDIS_REPLY_STATUS);
-        c->obuf = sdscat(c->obuf,"SET foo_rand000000000000 ");
+        c->obuf = sdscat(c->obuf,"*3\r\n$3\r\nSET\r\n$20\r\nfoo_rand000000000000\r\n");
         {
             char *data = zmalloc(config.datasize+2);
             memset(data,'x',config.datasize);
             data[config.datasize] = '\r';
             data[config.datasize+1] = '\n';
         {
             char *data = zmalloc(config.datasize+2);
             memset(data,'x',config.datasize);
             data[config.datasize] = '\r';
             data[config.datasize+1] = '\n';
+            c->obuf = sdscatprintf(c->obuf,"$%d\r\n",config.datasize);
             c->obuf = sdscatlen(c->obuf,data,config.datasize+2);
         }
         createMissingClients(c);
             c->obuf = sdscatlen(c->obuf,data,config.datasize+2);
         }
         createMissingClients(c);