Permalink
Browse files

Use multi-bulk protocol in SET benchmark

  • Loading branch information...
1 parent 8146e31 commit feecb608ed0ec8f9932960d5fa8f02e551ffbe59 @pietern pietern committed Nov 5, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/redis-benchmark.c
View
3 src/redis-benchmark.c
@@ -467,12 +467,13 @@ int main(int argc, char **argv) {
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';
+ c->obuf = sdscatprintf(c->obuf,"$%d\r\n",config.datasize);
c->obuf = sdscatlen(c->obuf,data,config.datasize+2);
}
createMissingClients(c);

0 comments on commit feecb60

Please sign in to comment.