report swap mem as bytes like other metrics (#24455)

This commit is contained in:
Jeff Washington (jwash) 2022-04-19 10:03:25 -05:00 committed by GitHub
parent 4fdf966393
commit d9d0dad258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -294,13 +294,13 @@ impl SystemMonitorService {
}
fn report_mem_stats() {
// get mem info (in kb)
if let Ok(info) = sys_info::mem_info() {
// stats are returned in kb.
const KB: u64 = 1_024;
datapoint_info!(
"memory-stats",
("total", info.total * KB, i64),
("swap_total", info.swap_total, i64),
("swap_total", info.swap_total * KB, i64),
(
"free_percent",
Self::calc_percent(info.free, info.total),