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
57e931de
Commit
57e931de
authored
Jul 08, 2014
by
antirez
Browse files
Fix analyzeLatencyForEvent() MAD computation.
parent
2a232dfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/latency.c
View file @
57e931de
...
@@ -178,7 +178,7 @@ void analyzeLatencyForEvent(char *event, struct latencyStats *ls) {
...
@@ -178,7 +178,7 @@ void analyzeLatencyForEvent(char *event, struct latencyStats *ls) {
int64_t
delta
;
int64_t
delta
;
if
(
ts
->
samples
[
j
].
time
==
0
)
continue
;
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
;
if
(
delta
<
0
)
delta
=
-
delta
;
sum
+=
delta
;
sum
+=
delta
;
}
}
...
@@ -219,12 +219,12 @@ sds createLatencyReport(void) {
...
@@ -219,12 +219,12 @@ sds createLatencyReport(void) {
analyzeLatencyForEvent
(
event
,
&
ls
);
analyzeLatencyForEvent
(
event
,
&
ls
);
report
=
sdscatprintf
(
report
,
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
,
eventnum
,
event
,
ls
.
samples
,
ls
.
samples
,
(
unsigned
long
)
ls
.
avg
,
(
unsigned
long
)
ls
.
avg
,
(
unsigned
long
)
ls
.
mad
,
(
unsigned
long
)
ls
.
mad
,
(
unsigned
long
)
ls
.
period
/
ls
.
samples
,
(
double
)
ls
.
period
/
ls
.
samples
,
(
unsigned
long
)
ts
->
max
);
(
unsigned
long
)
ts
->
max
);
/* Add some event specific information. */
/* 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