Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f9bababa
Commit
f9bababa
authored
Feb 13, 2019
by
Madelyn Olson
Browse files
Rename variable
parent
93640b0a
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
f9bababa
...
@@ -443,6 +443,7 @@ static int ipow(int base, int exp) {
...
@@ -443,6 +443,7 @@ static int ipow(int base, int exp) {
static
void
showLatencyReport
(
void
)
{
static
void
showLatencyReport
(
void
)
{
int
i
,
curlat
=
0
;
int
i
,
curlat
=
0
;
int
usbetweenlat
=
ipow
(
10
,
MAX_LATENCY_PRECISION
-
config
.
precision
);
float
perc
,
reqpersec
;
float
perc
,
reqpersec
;
reqpersec
=
(
float
)
config
.
requests_finished
/
((
float
)
config
.
totlatency
/
1000
);
reqpersec
=
(
float
)
config
.
requests_finished
/
((
float
)
config
.
totlatency
/
1000
);
...
@@ -457,8 +458,8 @@ static void showLatencyReport(void) {
...
@@ -457,8 +458,8 @@ static void showLatencyReport(void) {
qsort
(
config
.
latency
,
config
.
requests
,
sizeof
(
long
long
),
compareLatency
);
qsort
(
config
.
latency
,
config
.
requests
,
sizeof
(
long
long
),
compareLatency
);
for
(
i
=
0
;
i
<
config
.
requests
;
i
++
)
{
for
(
i
=
0
;
i
<
config
.
requests
;
i
++
)
{
if
(
config
.
latency
[
i
]
/
ipow
(
10
,
MAX_LATENCY_PRECISION
-
config
.
precision
)
!=
curlat
||
i
==
(
config
.
requests
-
1
))
{
if
(
config
.
latency
[
i
]
/
usbetweenlat
!=
curlat
||
i
==
(
config
.
requests
-
1
))
{
curlat
=
config
.
latency
[
i
]
/
ipow
(
10
,
MAX_LATENCY_PRECISION
-
config
.
precision
)
;
curlat
=
config
.
latency
[
i
]
/
usbetweenlat
;
perc
=
((
float
)(
i
+
1
)
*
100
)
/
config
.
requests
;
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
));
}
}
...
...
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