]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: add 'size_utilized' to bucket stats
authorCasey Bodley <cbodley@redhat.com>
Thu, 29 Sep 2016 21:30:29 +0000 (17:30 -0400)
committerAdam Kupczyk <akupczyk@mirantis.com>
Wed, 2 Nov 2016 11:13:06 +0000 (12:13 +0100)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_common.h
src/rgw/rgw_json_enc.cc
src/rgw/rgw_rados.cc

index dc581bfba42e20a383a599b1a2e168d6ac4b160f..b5e3763251abadd09dbdd878bce1ee085e8c37a9 100644 (file)
@@ -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()
index 034a488c744bf6c659df079fe527c4a55b1b91de..12f25e1742f44975fd110191108c9b19a32fb4ea 100644 (file)
@@ -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);
 }
 
index fd13ba9e4607f39476f6c37c54bd8d5d6abdc779..61223e8001d5c2c2efc623b483d431ed9821025c 100644 (file)
@@ -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;
   }
 }