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
31e1e30a
Commit
31e1e30a
authored
Jul 08, 2014
by
antirez
Browse files
Fix analyzeLatencyForEvent() MAD computation.
parent
9ed02e13
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/latency.c
View file @
31e1e30a
...
...
@@ -178,7 +178,7 @@ void analyzeLatencyForEvent(char *event, struct latencyStats *ls) {
int64_t
delta
;
if
(
ts
->
samples
[
j
].
time
==
0
)
continue
;
delta
=
ls
->
avg
-
ts
->
samples
[
j
].
latency
;
delta
=
(
int64_t
)
ls
->
avg
-
ts
->
samples
[
j
].
latency
;
if
(
delta
<
0
)
delta
=
-
delta
;
sum
+=
delta
;
}
...
...
@@ -219,12 +219,12 @@ sds createLatencyReport(void) {
analyzeLatencyForEvent
(
event
,
&
ls
);
report
=
sdscatprintf
(
report
,
"%d. %s: %d latency spikes (average %lums, mean deviation %lums, period %
lu
sec). Worst all time event %lums."
,
"%d. %s: %d latency spikes (average %lums, mean deviation %lums, period %
.2f
sec). Worst all time event %lums."
,
eventnum
,
event
,
ls
.
samples
,
(
unsigned
long
)
ls
.
avg
,
(
unsigned
long
)
ls
.
mad
,
(
unsigned
long
)
ls
.
period
/
ls
.
samples
,
(
double
)
ls
.
period
/
ls
.
samples
,
(
unsigned
long
)
ts
->
max
);
/* Add some event specific information. */
...
...
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