提交 e400ae60 编写于 作者: A antirez

Latency monitor: command duration is in useconds. Convert.

上级 a57eb327
...@@ -36,7 +36,7 @@ void latencyAddSample(char *event, mstime_t latency); ...@@ -36,7 +36,7 @@ void latencyAddSample(char *event, mstime_t latency);
/* Add the sample only if the elapsed time is >= to the configured threshold. */ /* Add the sample only if the elapsed time is >= to the configured threshold. */
#define latencyAddSampleIfNeeded(event,var) \ #define latencyAddSampleIfNeeded(event,var) \
if (server.latency_monitor_threshold && \ if (server.latency_monitor_threshold && \
var >= server.latency_monitor_threshold) \ (var) >= server.latency_monitor_threshold) \
latencyAddSample(event,var); latencyAddSample((event),(var));
#endif /* __LATENCY_H */ #endif /* __LATENCY_H */
...@@ -1934,7 +1934,7 @@ void call(redisClient *c, int flags) { ...@@ -1934,7 +1934,7 @@ void call(redisClient *c, int flags) {
if (flags & REDIS_CALL_SLOWLOG && c->cmd->proc != execCommand) { if (flags & REDIS_CALL_SLOWLOG && c->cmd->proc != execCommand) {
char *latency_event = (c->cmd->flags & REDIS_CMD_FAST) ? char *latency_event = (c->cmd->flags & REDIS_CMD_FAST) ?
"fast-command" : "command"; "fast-command" : "command";
latencyAddSampleIfNeeded(latency_event,duration); latencyAddSampleIfNeeded(latency_event,duration/1000);
slowlogPushEntryIfNeeded(c->argv,c->argc,duration); slowlogPushEntryIfNeeded(c->argv,c->argc,duration);
} }
if (flags & REDIS_CALL_STATS) { if (flags & REDIS_CALL_STATS) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册