mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-08 16:03:20 +00:00
add fmt formatter for `utils::pretty_printed_data_size` and `utils::pretty_printed_throughput`. this is a part of a series to migrating from `operator<<(ostream&, ..)` based formatting to fmtlib based formatting. the goal here is to enable fmtlib to print `utils::pretty_printed_data_size` and `utils::pretty_printed_throughput` without the help of `operator<<`. please note, despite that it's more popular to use the IEC prefixes when presenting the size of storage, i.e., MiB for 1024**2 bytes instead of MB for 1000**2 bytes, we are still using the SI binary prefixes as the default binary prefix, in order to preserve the existing behavior. also, we use the singular form of "byte" when formating "1". this is more correct. the tests are updated accordingly. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>