Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixficsol committed Jul 4, 2023
1 parent 4d87d3b commit 91ba4f8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/pika_admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class InfoCmd : public Cmd {
kInfo,
kInfoAll,
kInfoDebug,
kInfoCommandstats
kInfoCommandStats
};

InfoCmd(const std::string& name, int arity, uint16_t flag) : Cmd(name, arity, flag) {}
Expand All @@ -238,7 +238,7 @@ class InfoCmd : public Cmd {
const static std::string kDataSection;
const static std::string kRocksDBSection;
const static std::string kDebugSection;
const static std::string kCommandstatsSection;
const static std::string kCommandStatsSection;

void DoInitial() override;
void Clear() override {
Expand Down
2 changes: 1 addition & 1 deletion include/pika_cmd_table_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PikaCmdTableManager {
std::shared_ptr<Cmd> GetCmd(const std::string& opt);
uint32_t DistributeKey(const std::string& key, uint32_t slot_num);
bool CmdExist(const std::string& cmd) const;
CmdTable* Getcmdtable();
CmdTable* GetCmdTable();

private:
std::shared_ptr<Cmd> NewCommand(const std::string& opt);
Expand Down
10 changes: 5 additions & 5 deletions src/pika_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ const std::string InfoCmd::kKeyspaceSection = "keyspace";
const std::string InfoCmd::kDataSection = "data";
const std::string InfoCmd::kRocksDBSection = "rocksdb";
const std::string InfoCmd::kDebugSection = "debug";
const std::string InfoCmd::kCommandstatsSection = "commandstats";
const std::string InfoCmd::kCommandStatsSection = "commandstats";

void InfoCmd::DoInitial() {
size_t argc = argv_.size();
Expand Down Expand Up @@ -703,8 +703,8 @@ void InfoCmd::DoInitial() {
info_section_ = kInfoRocksDB;
} else if (strcasecmp(argv_[1].data(), kDebugSection.data()) == 0) {
info_section_ = kInfoDebug;
} else if (strcasecmp(argv_[1].data(), kCommandstatsSection.data()) == 0) {
info_section_ = kInfoCommandstats;
} else if (strcasecmp(argv_[1].data(), kCommandStatsSection.data()) == 0) {
info_section_ = kInfoCommandStats;
} else {
info_section_ = kInfoErr;
}
Expand Down Expand Up @@ -780,7 +780,7 @@ void InfoCmd::Do(std::shared_ptr<Slot> slot) {
case kInfoDebug:
InfoDebug(info);
break;
case kInfoCommandstats:
case kInfoCommandStats:
InfoCommandStats(info);
break;
default:
Expand Down Expand Up @@ -1224,7 +1224,7 @@ void InfoCmd::InfoCommandStats(std::string& info) {
tmp_stream.precision(2);
tmp_stream.setf(std::ios::fixed);
tmp_stream << "# Commandstats" << "\r\n";
for (auto& iter : *g_pika_cmd_table_manager->Getcmdtable()) {
for (auto& iter : *g_pika_cmd_table_manager->GetCmdTable()) {
if (iter.second->state.cmd_count != 0) {
tmp_stream << "cmdstat_" << iter.first << ":"
<< "calls=" << iter.second->state.cmd_count << ",usec="
Expand Down
2 changes: 1 addition & 1 deletion src/pika_client_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ std::shared_ptr<Cmd> PikaClientConn::DoCmd(const PikaCmdArgsType& argv, const st
// Process Command
c_ptr->Execute();
int64_t duration = pstd::NowMicros() - start_us;
auto iter = g_pika_cmd_table_manager->Getcmdtable();
auto iter = g_pika_cmd_table_manager->GetCmdTable();
(*iter)[opt]->state.cmd_count.fetch_add(1);
(*iter)[opt]->state.cmd_time_consuming.fetch_add(duration);

Expand Down
2 changes: 1 addition & 1 deletion src/pika_cmd_table_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std::shared_ptr<Cmd> PikaCmdTableManager::NewCommand(const std::string& opt) {
return nullptr;
}

CmdTable* PikaCmdTableManager::Getcmdtable() {
CmdTable* PikaCmdTableManager::GetCmdTable() {
return cmds_.get();
}

Expand Down

0 comments on commit 91ba4f8

Please sign in to comment.