Skip to content

Adding kilobytes to formatter

Adam Mulvany requested to merge adding-kilobytes-to-formatter into main

Previously we would take the output from the command.maxrss, multiply x 1024 and send it to the byte-unit to format it as bytes.

The formatter would choose the appropriate unit type (MiB, GiB, TiB etc) and apply it to the output.

Wikipedia says regarding RSS that:

resident set size (RSS) is the portion of memory (measured in kilobytes)

So I have added a new helper method that will format all RSS values in KB instead of dynamically selecting the unit type.

Also the correct calculation is x 1000 according to the library docs so I've changed this from 1024.

Also there was one place we weren't multiplying it giving conflicting data and this has been fixed.

Lastly I had to update all of the cargo insta snapshots to reflect the changes in output and recommit them to pass the tests.

Fixes #39 (closed)

Edited by Adam Mulvany

Merge request reports