| 397 | } |
| 398 | |
| 399 | Status Connection::ExecuteCommand(engine::Context &ctx, const std::string &cmd_name, |
| 400 | const std::vector<std::string> &cmd_tokens, Commander *current_cmd, |
| 401 | std::string *reply) { |
| 402 | srv_->stats.IncrCalls(cmd_name); |
| 403 | |
| 404 | auto start = std::chrono::high_resolution_clock::now(); |
| 405 | bool is_profiling = IsProfilingEnabled(cmd_name); |
| 406 | auto s = current_cmd->Execute(ctx, srv_, this, reply); |
| 407 | auto end = std::chrono::high_resolution_clock::now(); |
| 408 | uint64_t duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count(); |
| 409 | if (is_profiling) RecordProfilingSampleIfNeed(cmd_name, duration); |
| 410 | |
| 411 | srv_->SlowlogPushEntryIfNeeded(&cmd_tokens, duration, this); |
| 412 | srv_->stats.IncrLatency(static_cast<uint64_t>(duration), cmd_name); |
| 413 | return s; |
| 414 | } |
| 415 | |
| 416 | static bool IsCmdForIndexing(uint64_t cmd_flags, CommandCategory cmd_cat) { |
| 417 | return (cmd_flags & redis::kCmdWrite) && |
no test coverage detected