implement dataUnits finally

Added support for "megabit" and related bandwidth units in
annex.stalldetection and everywhere else that git-annex parses data units.

Note that the short form is "Mbit" not "Mb" because that differs from "MB"
only in case, and git-annex parses units case-insensitively. It would be
horrible if two different versions of git-annex parsed the same value
differently, so I don't think "Mb" can be supported.

See comment for bonus sad story from my childhood.

Sponsored-by: Nicholas Golder-Manning
This commit is contained in:
Joey Hess 2022-05-05 15:22:11 -04:00
parent 3d8af64527
commit d1cce869ed
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 47 additions and 7 deletions

View file

@ -9,3 +9,9 @@ and match up with the other bandwidth displays.
This might make sense as a per-remote configurable value. Allowing
using MiB/s for a hard drive and Mbps for a network remote. --[[Joey]]
> I've implemented bandwidthUnits now, but it's not used for display yet.
> It is possible to specify such units in eg annex.stalldetection now.
> Note that it uses Mbit, not Mb because that is just confusingly close to
> "MB" and git-annex parses data units case insensitively. So the actual
> display will end up being "Mbit/s" rather than Mbps probably. --[[Joey]]