MCPcopy Create free account
hub / github.com/apache/kvrocks / ExecuteCommand

Method ExecuteCommand

src/server/redis_connection.cc:399–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399Status 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
416static bool IsCmdForIndexing(uint64_t cmd_flags, CommandCategory cmd_cat) {
417 return (cmd_flags & redis::kCmdWrite) &&

Callers 1

RedisGenericCommandFunction · 0.80

Calls 4

IncrCallsMethod · 0.80
IncrLatencyMethod · 0.80
ExecuteMethod · 0.45

Tested by

no test coverage detected