Fix ps sys units (#2967)

* Fix the units for sys and ps

* Better conversion
This commit is contained in:
Jonathan Turner
2021-01-25 08:34:43 +13:00
committed by GitHub
parent 52dc04a35a
commit b692ca7896
2 changed files with 9 additions and 6 deletions

View File

@ -100,10 +100,10 @@ pub fn mem(sys: &mut System, tag: Tag) -> Option<UntaggedValue> {
let total_swap = sys.get_total_swap();
let free_swap = sys.get_free_swap();
dict.insert_untagged("total", UntaggedValue::filesize(total_mem));
dict.insert_untagged("free", UntaggedValue::filesize(free_mem));
dict.insert_untagged("swap total", UntaggedValue::filesize(total_swap));
dict.insert_untagged("swap free", UntaggedValue::filesize(free_swap));
dict.insert_untagged("total", UntaggedValue::filesize(total_mem * 1000));
dict.insert_untagged("free", UntaggedValue::filesize(free_mem * 1000));
dict.insert_untagged("swap total", UntaggedValue::filesize(total_swap * 1000));
dict.insert_untagged("swap free", UntaggedValue::filesize(free_swap * 1000));
Some(dict.into_untagged_value())
}