]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add counter to trace extents have been removed due to compression
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 18 Nov 2016 06:22:04 +0000 (14:22 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 18 Nov 2016 08:18:39 +0000 (16:18 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index a455225cec91edecef7039e920a762a14ee8bb31..25b5a63c5498245531a927cdc3887fc08f313e76 100644 (file)
@@ -2147,6 +2147,9 @@ int BlueStore::ExtentMap::compress_extent_map(uint64_t offset, uint64_t length)
       }
     }
   }
+  if (removed && onode) {
+    onode->c->store->logger->inc(l_bluestore_extent_compress, removed);
+  }
   return removed;
 }
 
@@ -2713,6 +2716,8 @@ void BlueStore::_init_logger()
            "Onode extent map reshard events");
   b.add_u64(l_bluestore_blob_split, "bluestore_blob_split",
             "Sum for blob splitting due to resharding");
+  b.add_u64(l_bluestore_extent_compress, "bluestore_extent_compress",
+            "Sum for extents that have been removed due to compression");
   logger = b.create_perf_counters();
   g_ceph_context->get_perfcounters_collection()->add(logger);
 }
index 13db970ac993ac95a6ee53bfebf5c8af3b113c75..02b30b73926acca13b17724c22eca162465308dd 100644 (file)
@@ -94,6 +94,7 @@ enum {
   l_bluestore_txc,
   l_bluestore_onode_reshard,
   l_bluestore_blob_split,
+  l_bluestore_extent_compress,
   l_bluestore_last
 };
 
@@ -1542,7 +1543,7 @@ private:
   size_t block_size_order; ///< bits to shift to get block size
 
   uint64_t min_alloc_size = 0; ///< minimum allocation unit (power of 2)
-  uint64_t min_min_alloc_size = 0; /// < minimum seen min_alloc_size
+  uint64_t min_min_alloc_size = 0; ///< minimum seen min_alloc_size
   size_t min_alloc_size_order = 0; ///< bits for min_alloc_size
 
   uint64_t max_alloc_size; ///< maximum allocation unit (power of 2)