chore: get rid of cmdstats_map (#1687)

cmdstats_map were on the hotpath and are needed only to update the command stats.
Instead, I introduced the stats withing the CommandId itself that we lookup anyways.
Also, it removes fragile dependency on naked command name char* pointers.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2023-08-10 20:13:02 +03:00 committed by GitHub
parent 3a832b5620
commit a743d7577a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 28 deletions

View file

@ -68,6 +68,10 @@ class Service : public facade::ServiceInterface {
return registry_.Find(cmd);
}
CommandRegistry* mutable_registry() {
return &registry_;
}
facade::ErrorReply ReportUnknownCmd(std::string_view cmd_name);
// Returns: the new state.