Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d1a21e02
Unverified
Commit
d1a21e02
authored
Jun 24, 2021
by
Huang Zhw
Committed by
GitHub
Jun 24, 2021
Browse files
Clean redis-benchmark Throughput output. (#9139)
some leftovers from print are visible when the new line is printed.
parent
89ae3537
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
d1a21e02
...
@@ -1649,6 +1649,7 @@ int showThroughput(struct aeEventLoop *eventLoop, long long id, void *clientData
...
@@ -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
;
const
float
instantaneous_rps
=
(
float
)(
requests_finished
-
previous_requests_finished
)
/
instantaneous_dt
;
config
.
previous_tick
=
current_tick
;
config
.
previous_tick
=
current_tick
;
atomicSet
(
config
.
previous_requests_finished
,
requests_finished
);
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
.
0
f
,
hdr_mean
(
config
.
latency_histogram
)
/
1000
.
0
f
);
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
.
0
f
,
hdr_mean
(
config
.
latency_histogram
)
/
1000
.
0
f
);
if
(
printed_bytes
>
config
.
last_printed_bytes
){
if
(
printed_bytes
>
config
.
last_printed_bytes
){
config
.
last_printed_bytes
=
printed_bytes
;
config
.
last_printed_bytes
=
printed_bytes
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment