mirror of
https://github.com/fluencelabs/redis
synced 2025-03-23 19:10:51 +00:00
FIXED redis-benchmark's idle mode.With idle mode shouldn't create write event
This commit is contained in:
parent
93eed9ae01
commit
b4c4be785c
@ -390,6 +390,7 @@ static client createClient(char *cmd, size_t len, client from) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (config.idlemode == 0)
|
||||||
aeCreateFileEvent(config.el,c->context->fd,AE_WRITABLE,writeHandler,c);
|
aeCreateFileEvent(config.el,c->context->fd,AE_WRITABLE,writeHandler,c);
|
||||||
listAddNodeTail(config.clients,c);
|
listAddNodeTail(config.clients,c);
|
||||||
config.liveclients++;
|
config.liveclients++;
|
||||||
@ -600,8 +601,12 @@ int showThroughput(struct aeEventLoop *eventLoop, long long id, void *clientData
|
|||||||
fprintf(stderr,"All clients disconnected... aborting.\n");
|
fprintf(stderr,"All clients disconnected... aborting.\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.csv) return 250;
|
if (config.csv) return 250;
|
||||||
|
if (config.idlemode == 1) {
|
||||||
|
printf("clients: %d\r", config.liveclients);
|
||||||
|
fflush(stdout);
|
||||||
|
return 250;
|
||||||
|
}
|
||||||
float dt = (float)(mstime()-config.start)/1000.0;
|
float dt = (float)(mstime()-config.start)/1000.0;
|
||||||
float rps = (float)config.requests_finished/dt;
|
float rps = (float)config.requests_finished/dt;
|
||||||
printf("%s: %.2f\r", config.title, rps);
|
printf("%s: %.2f\r", config.title, rps);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user