fix #5024 - commandstats for multi-exec were logged as EXEC.

this was broken a while back by ba9154d7e7
the purpose of which was to fix commandstats for GEOADD
This commit is contained in:
Oran Agra
2018-09-30 11:37:19 +03:00
committed by antirez
parent a996b2a285
commit d6aeca862c
2 changed files with 63 additions and 2 deletions

View File

@ -2408,6 +2408,7 @@ void preventCommandReplication(client *c) {
void call(client *c, int flags) {
long long dirty, start, duration;
int client_old_flags = c->flags;
struct redisCommand *real_cmd = c->cmd;
/* Sent the command to clients in MONITOR mode, only if the commands are
* not generated from reading an AOF. */
@ -2456,8 +2457,11 @@ void call(client *c, int flags) {
slowlogPushEntryIfNeeded(c,c->argv,c->argc,duration);
}
if (flags & CMD_CALL_STATS) {
c->lastcmd->microseconds += duration;
c->lastcmd->calls++;
/* use the real command that was executed (cmd and lastamc) may be
* different, in case of MULTI-EXEC or re-written commands such as
* EXPIRE, GEOADD, etc. */
real_cmd->microseconds += duration;
real_cmd->calls++;
}
/* Propagate the command into the AOF and replication link */