various: cleanup
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I26df4d852b4b22d0df6b6871fe9cbde96a6a6964
This commit is contained in:
parent
f0aa256785
commit
4f9c7057ff
7 changed files with 778 additions and 62 deletions
|
|
@ -68,14 +68,12 @@ impl Scanner for SystemScanner {
|
|||
MetricValue::Integer(*available as i64),
|
||||
);
|
||||
}
|
||||
if let Some(used) = mem.get("MemAvailable") {
|
||||
if let Some(total) = mem.get("MemTotal") {
|
||||
let used_mem = total.saturating_sub(*used);
|
||||
metrics.insert(
|
||||
"mem_used_bytes".to_string(),
|
||||
MetricValue::Integer(used_mem as i64),
|
||||
);
|
||||
}
|
||||
if let (Some(used), Some(total)) = (mem.get("MemAvailable"), mem.get("MemTotal")) {
|
||||
let used_mem = total.saturating_sub(*used);
|
||||
metrics.insert(
|
||||
"mem_used_bytes".to_string(),
|
||||
MetricValue::Integer(used_mem as i64),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue