From: John Spray Date: Wed, 14 Feb 2018 15:19:54 +0000 (+0000) Subject: mon: dump percent_used PGMap field as float X-Git-Tag: v13.0.2~221^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c15cf4d83f13505c48d4ea181ee8a6ba4b9a2949;p=ceph.git mon: dump percent_used PGMap field as float Formatting this as a string was awkward for anyone consuming it from other code. Signed-off-by: John Spray --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 0876abede7bc..188eb97eb067 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -877,7 +877,7 @@ void PGMapDigest::dump_object_stat_sum( if (f) { f->dump_int("kb_used", shift_round_up(sum.num_bytes, 10)); f->dump_int("bytes_used", sum.num_bytes); - f->dump_format_unquoted("percent_used", "%.2f", (used*100)); + f->dump_float("percent_used", used); f->dump_unsigned("max_avail", avail / raw_used_rate); f->dump_int("objects", sum.num_objects); if (verbose) {