]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: calculate num_user_bytes
authorSage Weil <sage@redhat.com>
Wed, 20 Aug 2014 04:33:52 +0000 (21:33 -0700)
committerSage Weil <sage@redhat.com>
Fri, 29 Aug 2014 23:52:38 +0000 (16:52 -0700)
This is the bytes stored by the user, excluding hit_sets.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc

index a658f17273bc8bcd2e567467b0d41e70061b4193..bd55f1057f259bd6fb01475b94de3b0342a4127d 100644 (file)
@@ -11568,8 +11568,6 @@ void ReplicatedPG::agent_choose_mode(bool restart)
   uint64_t divisor = pool.info.get_pg_num_divisor(info.pgid.pgid);
   assert(divisor > 0);
 
-  uint64_t num_user_objects = info.stats.stats.sum.num_objects;
-
   // adjust (effective) user objects down based on the number
   // of HitSet objects, which should not count toward our total since
   // they cannot be flushed.
@@ -11581,12 +11579,16 @@ void ReplicatedPG::agent_choose_mode(bool restart)
   if (base_pool->is_erasure())
     unflushable += info.stats.stats.sum.num_objects_omap;
 
-
+  uint64_t num_user_objects = info.stats.stats.sum.num_objects;
   if (num_user_objects > unflushable)
     num_user_objects -= unflushable;
   else
     num_user_objects = 0;
 
+  uint64_t num_user_bytes = info.stats.stats.sum.num_bytes;
+  uint64_t unflushable_bytes = info.stats.stats.sum.num_bytes_hit_set_archive;
+  num_user_bytes -= unflushable_bytes;
+
   // also reduce the num_dirty by num_objects_omap
   int64_t num_dirty = info.stats.stats.sum.num_objects_dirty;
   if (base_pool->is_erasure()) {
@@ -11607,6 +11609,7 @@ void ReplicatedPG::agent_choose_mode(bool restart)
           << " num_objects_omap: " << info.stats.stats.sum.num_objects_omap
           << " num_dirty: " << num_dirty
           << " num_user_objects: " << num_user_objects
+          << " num_user_bytes: " << num_user_bytes
           << " pool.info.target_max_bytes: " << pool.info.target_max_bytes
           << " pool.info.target_max_objects: " << pool.info.target_max_objects
           << dendl;