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
05676c5d
Commit
05676c5d
authored
May 23, 2014
by
Jan-Erik Rediger
Committed by
antirez
Aug 07, 2014
Browse files
redis-cli: fix latency result output
(Cleaned up a little by @mattsta) Closes #1774
parent
5b393065
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
05676c5d
...
@@ -1850,11 +1850,15 @@ static void intrinsicLatencyMode(void) {
...
@@ -1850,11 +1850,15 @@ static void intrinsicLatencyMode(void) {
printf
(
"Max latency so far: %lld microseconds.
\n
"
,
max_latency
);
printf
(
"Max latency so far: %lld microseconds.
\n
"
,
max_latency
);
}
}
double
avg_us
=
(
double
)
run_time
/
runs
;
double
avg_ns
=
avg_us
*
10e3
;
if
(
force_cancel_loop
||
end
>
test_end
)
{
if
(
force_cancel_loop
||
end
>
test_end
)
{
printf
(
"
\n
%lld total runs (avg %lld microseconds per run).
\n
"
,
printf
(
"
\n
%lld total runs "
runs
,
run_time
/
runs
);
"(avg latency: "
printf
(
"Worst run took %.02fx times the average.
\n
"
,
"%.4f microseconds / %.2f nanoseconds per run).
\n
"
,
(
double
)
max_latency
/
(
run_time
/
runs
));
runs
,
avg_us
,
avg_ns
);
printf
(
"Worst run took %.0fx longer than the average latency.
\n
"
,
max_latency
/
avg_us
);
exit
(
0
);
exit
(
0
);
}
}
}
}
...
...
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