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
b79efef5
Commit
b79efef5
authored
Feb 24, 2019
by
Madelyn Olson
Browse files
Updated redis-benchmark so it doesn't show 1 value above 2ms at higher precision
parent
07473fea
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
b79efef5
...
...
@@ -461,18 +461,18 @@ static void showLatencyReport(void) {
if
(
config
.
latency
[
i
]
/
usbetweenlat
!=
curlat
||
i
==
(
config
.
requests
-
1
))
{
curlat
=
config
.
latency
[
i
]
/
usbetweenlat
;
perc
=
((
float
)(
i
+
1
)
*
100
)
/
config
.
requests
;
printf
(
"%.2f%% <= %.*f milliseconds
\n
"
,
perc
,
config
.
precision
,
curlat
/
pow
(
10
.
0
,
config
.
precision
));
/* After the 2 milliseconds latency to have percentages split
* by decimals will just add a lot of noise to the output. */
if
(
config
.
latency
[
i
]
>
2000
)
{
if
(
config
.
latency
[
i
]
>
=
2000
)
{
config
.
precision
=
0
;
usbetweenlat
=
ipow
(
10
,
MAX_LATENCY_PRECISION
-
config
.
precision
);
}
curlat
=
config
.
latency
[
i
]
/
usbetweenlat
;
perc
=
((
float
)(
i
+
1
)
*
100
)
/
config
.
requests
;
printf
(
"%.2f%% <= %.*f milliseconds
\n
"
,
perc
,
config
.
precision
,
curlat
/
pow
(
10
.
0
,
config
.
precision
));
}
}
printf
(
"%.2f requests per second
\n\n
"
,
reqpersec
);
...
...
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