Clean redis-benchmark Throughput output. (#9139)

some leftovers from print are visible when the new line is printed.
This commit is contained in:
Huang Zhw 2021-06-24 23:04:19 +08:00 committed by GitHub
parent 89ae353748
commit d1a21e0292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1649,6 +1649,7 @@ int showThroughput(struct aeEventLoop *eventLoop, long long id, void *clientData
const float instantaneous_rps = (float)(requests_finished-previous_requests_finished)/instantaneous_dt;
config.previous_tick = current_tick;
atomicSet(config.previous_requests_finished,requests_finished);
printf("%*s\r", config.last_printed_bytes, " "); /* ensure there is a clean line */
int printed_bytes = printf("%s: rps=%.1f (overall: %.1f) avg_msec=%.3f (overall: %.3f)\r", config.title, instantaneous_rps, rps, hdr_mean(config.current_sec_latency_histogram)/1000.0f, hdr_mean(config.latency_histogram)/1000.0f);
if (printed_bytes > config.last_printed_bytes){
config.last_printed_bytes = printed_bytes;