fix sys info mem usage (#6607)

This commit is contained in:
WindSoilder 2022-09-24 00:47:52 +08:00 committed by GitHub
parent 2e23d4d734
commit d323ac3edc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -276,43 +276,43 @@ pub fn mem(sys: &mut System, span: Span) -> Option<Value> {
cols.push("total".into());
vals.push(Value::Filesize {
val: total_mem as i64 * 1000,
val: total_mem as i64,
span,
});
cols.push("free".into());
vals.push(Value::Filesize {
val: free_mem as i64 * 1000,
val: free_mem as i64,
span,
});
cols.push("used".into());
vals.push(Value::Filesize {
val: used_mem as i64 * 1000,
val: used_mem as i64,
span,
});
cols.push("available".into());
vals.push(Value::Filesize {
val: avail_mem as i64 * 1000,
val: avail_mem as i64,
span,
});
cols.push("swap total".into());
vals.push(Value::Filesize {
val: total_swap as i64 * 1000,
val: total_swap as i64,
span,
});
cols.push("swap free".into());
vals.push(Value::Filesize {
val: free_swap as i64 * 1000,
val: free_swap as i64,
span,
});
cols.push("swap used".into());
vals.push(Value::Filesize {
val: used_swap as i64 * 1000,
val: used_swap as i64,
span,
});