update MemFree to MemAvailable in keydb statsd
This commit is contained in:
parent
ffac55273a
commit
813bf15ae0
@ -535,10 +535,10 @@ void emit_system_free_memory() {
|
|||||||
std::ifstream meminfo("/proc/meminfo");
|
std::ifstream meminfo("/proc/meminfo");
|
||||||
std::string line;
|
std::string line;
|
||||||
while (std::getline(meminfo, line)) {
|
while (std::getline(meminfo, line)) {
|
||||||
if (line.find("MemFree:") != std::string::npos) {
|
if (line.find("MemAvailable:") != std::string::npos) {
|
||||||
unsigned long memFreeInKB;
|
unsigned long memAvailableInKB;
|
||||||
std::sscanf(line.c_str(), "MemFree: %lu kB", &memFreeInKB);
|
std::sscanf(line.c_str(), "MemAvailable: %lu kB", &memAvailableInKB);
|
||||||
g_stats->gauge("systemFreeMemory_MB", memFreeInKB / 1024);
|
g_stats->gauge("systemAvailableMemory_MB", memAvailableInKB / 1024);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user