From c15cf4d83f13505c48d4ea181ee8a6ba4b9a2949 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 14 Feb 2018 15:19:54 +0000 Subject: [PATCH] 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 --- src/mon/PGMap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 0876abede7b..188eb97eb06 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) { -- 2.39.5