Skip to content

Commit

Permalink
chore: Record cmd stat from invoke (#2720)
Browse files Browse the repository at this point in the history
1. Pipeline squashing was not recorded
2. Apparently Redis counts commands of MULTI/EXEC transations separately, so I assume we also should
-> Place RecordCmd() in Invoke()
  • Loading branch information
dranikpg authored Mar 13, 2024
1 parent e9734e7 commit 12d76dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/main_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1127,8 +1127,6 @@ void Service::DispatchCommand(CmdArgList args, facade::ConnectionContext* cntx)
cntx->paused = false;
}

etl.RecordCmd();

if (auto err = VerifyCommandState(cid, args_no_cmd, *dfly_cntx); err) {
if (auto& exec_info = dfly_cntx->conn_state.exec_info; exec_info.IsCollecting())
exec_info.state = ConnectionState::ExecInfo::EXEC_ERROR;
Expand Down Expand Up @@ -1246,6 +1244,8 @@ bool Service::InvokeCmd(const CommandId* cid, CmdArgList tail_args, ConnectionCo
DispatchMonitor(cntx, cid, tail_args);
}

ServerState::tlocal()->RecordCmd();

#ifndef NDEBUG
// Verifies that we reply to the client when needed.
ReplyGuard reply_guard(cntx, cid->name());
Expand Down

0 comments on commit 12d76dd

Please sign in to comment.