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
485a5908
Commit
485a5908
authored
Jul 01, 2014
by
antirez
Browse files
Latency monitor: command duration is in useconds. Convert.
parent
41c9d1c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/latency.h
View file @
485a5908
...
...
@@ -36,7 +36,7 @@ void latencyAddSample(char *event, mstime_t latency);
/* Add the sample only if the elapsed time is >= to the configured threshold. */
#define latencyAddSampleIfNeeded(event,var) \
if (server.latency_monitor_threshold && \
var >= server.latency_monitor_threshold) \
latencyAddSample(event
,
var);
(
var
)
>= server.latency_monitor_threshold) \
latencyAddSample(
(
event
),(
var)
)
;
#endif
/* __LATENCY_H */
src/redis.c
View file @
485a5908
...
...
@@ -2026,7 +2026,7 @@ void call(redisClient *c, int flags) {
if (flags & REDIS_CALL_SLOWLOG && c->cmd->proc != execCommand) {
char *latency_event = (c->cmd->flags & REDIS_CMD_FAST) ?
"fast-command" : "command";
latencyAddSampleIfNeeded
(
latency_event
,
duration
);
latencyAddSampleIfNeeded(latency_event,duration
/1000
);
slowlogPushEntryIfNeeded(c->argv,c->argc,duration);
}
if (flags & REDIS_CALL_STATS) {
...
...
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