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

Function extractPropertyFromInfo

src/keydb-diagnostic-tool.cpp:783–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781}
782
783int extractPropertyFromInfo(const char *info, const char *key, double &val) {
784 char *line = strstr((char*)info, key);
785 if (line == nullptr) return 1;
786 line += strlen(key) + 1; // Skip past key name and following colon
787 char *newline = strchr(line, '\n');
788 *newline = 0; // Terminate string after relevant line
789 val = strtod(line, nullptr);
790 return 0;
791}
792
793int extractPropertyFromInfo(const char *info, const char *key, unsigned int &val) {
794 char *line = strstr((char*)info, key);

Callers 2

getServerCpuTimeFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected