From: Casey Bodley Date: Thu, 29 Sep 2016 21:30:29 +0000 (-0400) Subject: radosgw-admin: add 'size_utilized' to bucket stats X-Git-Tag: v11.1.0~429^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e67e85c954e22cd1b9ca02eace00c137cd7b9820;p=ceph.git radosgw-admin: add 'size_utilized' to bucket stats Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index dc581bfba42..b5e3763251a 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -1118,6 +1118,7 @@ struct RGWStorageStats RGWObjCategory category; uint64_t size; uint64_t size_rounded; + uint64_t size_utilized{0}; //< size after compression, encryption uint64_t num_objects; RGWStorageStats() diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index 034a488c744..12f25e1742f 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -595,8 +595,10 @@ void RGWStorageStats::dump(Formatter *f) const { encode_json("size", size, f); encode_json("size_actual", size_rounded, f); + encode_json("size_utilized", size_utilized, f); encode_json("size_kb", rgw_rounded_kb(size), f); encode_json("size_kb_actual", rgw_rounded_kb(size_rounded), f); + encode_json("size_kb_utilized", rgw_rounded_kb(size_utilized), f); encode_json("num_objects", num_objects, f); } diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index fd13ba9e460..61223e8001d 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -7968,6 +7968,7 @@ static void accumulate_raw_stats(const rgw_bucket_dir_header& header, s.category = category; s.size += header_stats.total_size; s.size_rounded += header_stats.total_size_rounded; + s.size_utilized += header_stats.actual_size; s.num_objects += header_stats.num_entries; } }