From: Casey Bodley Date: Thu, 29 Sep 2016 21:04:30 +0000 (-0400) Subject: rgw: use RGWStorageStats::dump() to format 'bucket stats' X-Git-Tag: v11.1.0~429^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b6e6fc107e7320f81ea9889a9fefc4f3afe7ffde;p=ceph.git rgw: use RGWStorageStats::dump() to format 'bucket stats' Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 979326fdd3e82..39f1107d011ba 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -976,11 +976,7 @@ static void dump_bucket_usage(map& stats, Forma RGWStorageStats& s = iter->second; const char *cat_name = rgw_obj_category_name(iter->first); formatter->open_object_section(cat_name); - formatter->dump_int("size", s.size); - formatter->dump_int("size_actual", s.size_rounded); - formatter->dump_int("size_kb", rgw_rounded_kb(s.size)); - formatter->dump_int("size_kb_actual", rgw_rounded_kb(s.size_rounded)); - formatter->dump_int("num_objects", s.num_objects); + s.dump(formatter); formatter->close_section(); } formatter->close_section(); diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index 62e702f02161c..034a488c744bf 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -594,9 +594,9 @@ void RGWBucketEntryPoint::decode_json(JSONObj *obj) { void RGWStorageStats::dump(Formatter *f) const { encode_json("size", size, f); - encode_json("size_rounded", size_rounded, f); - encode_json("num_kb", rgw_rounded_kb(size), f); - encode_json("num_kb_rounded", rgw_rounded_kb(size_rounded), f); + encode_json("size_actual", size_rounded, f); + encode_json("size_kb", rgw_rounded_kb(size), f); + encode_json("size_kb_actual", rgw_rounded_kb(size_rounded), f); encode_json("num_objects", num_objects, f); }