summaryrefslogtreecommitdiff
path: root/src/redis-benchmark.c
diff options
context:
space:
mode:
authorHuang Zhw <huang_zhw@126.com>2021-06-24 23:04:19 +0800
committerGitHub <noreply@github.com>2021-06-24 18:04:19 +0300
commitd1a21e02926b9c4cb850c076a445644562800bf1 (patch)
treefaa9a2321add635ccbb9c986d2e0ae26f5fa1ec9 /src/redis-benchmark.c
parent89ae353748cffc50dbb0222529fa765e156f2951 (diff)
downloadredis-d1a21e02926b9c4cb850c076a445644562800bf1.tar.gz
Clean redis-benchmark Throughput output. (#9139)
some leftovers from print are visible when the new line is printed.
Diffstat (limited to 'src/redis-benchmark.c')
-rw-r--r--src/redis-benchmark.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c
index 6761ee6f3..738aed5de 100644
--- a/src/redis-benchmark.c
+++ b/src/redis-benchmark.c
@@ -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;