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
86802d4f
Commit
86802d4f
authored
Feb 14, 2019
by
antirez
Browse files
redis-benchmark: default precision=1, integer ms after 2 milliseconds.
Reltaed to discussion and PR #5840.
parent
da86481e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
86802d4f
...
...
@@ -458,10 +458,21 @@ static void showLatencyReport(void) {
qsort
(
config
.
latency
,
config
.
requests
,
sizeof
(
long
long
),
compareLatency
);
for
(
i
=
0
;
i
<
config
.
requests
;
i
++
)
{
if
(
config
.
latency
[
i
]
/
usbetweenlat
!=
curlat
||
i
==
(
config
.
requests
-
1
))
{
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
));
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
)
{
config
.
precision
=
0
;
usbetweenlat
=
ipow
(
10
,
MAX_LATENCY_PRECISION
-
config
.
precision
);
}
}
}
printf
(
"%.2f requests per second
\n\n
"
,
reqpersec
);
...
...
@@ -699,7 +710,7 @@ int main(int argc, const char **argv) {
config
.
tests
=
NULL
;
config
.
dbnum
=
0
;
config
.
auth
=
NULL
;
config
.
precision
=
0
;
config
.
precision
=
1
;
i
=
parseOptions
(
argc
,
argv
);
argc
-=
i
;
...
...
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