MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / handleErrorStatItem

Function handleErrorStatItem

src/modules/keydb_modstatsd/modmain.cpp:352–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352void handleErrorStatItem(struct RedisModuleCtx *ctx, std::string name, std::string rest) {
353 size_t idx = rest.find('=');
354 if (idx != std::string::npos) {
355 std::string statValue = rest.substr(idx + 1);
356 long long val = strtoll(statValue.c_str(), nullptr, 10);
357 g_stats->gauge(name, val);
358 RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"%s\": %lld", name.c_str(), val);
359 } else {
360 RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_WARNING, "Unexpected errorstat line format returned by \"INFO\" command: \"%s\"", (name + rest).c_str());
361 }
362}
363
364void handleReplicaOrDbInfoItem(struct RedisModuleCtx *ctx, std::string name, std::string rest) {
365 //use a stringstream to extract each metric of the form <name>=<value>

Callers 1

handle_info_responseFunction · 0.85

Calls 2

findMethod · 0.45
gaugeMethod · 0.45

Tested by

no test coverage detected