HomePhabricator

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

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

Provenance
epriestleyAuthored on
epriestleyPushed on Oct 2 2014, 8:48 PM
Reviewer
chad
Differential Revision
D10631: Use normal human units, not "correct" SI units, when parsing MB/GB etc
Parents
rPHUb7c05df35726: Quiet utf8mb4 warnings when establish MySQL connections
Branches
Unknown
Tags
Unknown

Event Timeline