Homec4science

Use normal human units, not "correct" SI units, when parsing MB/GB etc

Authored by epriestley <git@epriestley.com> on Oct 2 2014, 22:48.

Description

Use normal human units, not "correct" SI units, when parsing MB/GB etc

Summary:
Technically, "KB" is "kilobyte" which is 1000 bytes, and "KiB" is "kibibyte" which is 1024 bytes. I implemented this function "correctly", but in practice we mostly use it to parse things from php.ini, mysql.cnf, etc., which all use units of 1024 intead of 1000. This ends up being really confusing because you write 128M in a file (technicall meaning "128 mebibytes") and then a setup warning says 137M (tehcnically meaning "137 megabytes").

Use the standard normal units that everyone and everything uses instead of the "correct" units. If we have some cause for the "real" SI units later we can mess with this stuff when we hit that.

Test Plan: Saw the setup check in D10630 actually report what I wrote in the file instead of a weird SI value.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10631

Details

Committed
epriestley <git@epriestley.com>Oct 2 2014, 22:48
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUb7c05df35726: Quiet utf8mb4 warnings when establish MySQL connections
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU984269c6a3a3: Use normal human units, not "correct" SI units, when parsing MB/GB etc (authored by epriestley <git@epriestley.com>).Oct 2 2014, 22:48