]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add counter to trace number of garbage collection reads
authorxie xingguo <xie.xingguo@zte.com.cn>
Sun, 9 Oct 2016 09:33:27 +0000 (17:33 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sun, 9 Oct 2016 09:33:27 +0000 (17:33 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index f7e145bed0e27b39f7841026cb3112f6da513441..cbacdcb04b6f1d53f5eaf8f595f6025aff597625 100644 (file)
@@ -2601,6 +2601,7 @@ void BlueStore::_init_logger()
   b.add_u64(l_bluestore_txc, "bluestore_txc", "Transactions committed");
   b.add_u64(l_bluestore_onode_reshard, "bluestore_onode_reshard",
            "Onode extent map reshard events");
+  b.add_u64(l_bluestore_gc, "bluestore_gc", "Sum for garbage collection reads");
   b.add_u64(l_bluestore_gc_bytes, "bluestore_gc_bytes", "garbage collected bytes");
   logger = b.create_perf_counters();
   g_ceph_context->get_perfcounters_collection()->add(logger);
@@ -7882,6 +7883,7 @@ int BlueStore::_do_write(
         o->extent_map.fault_range(db, gc_start_offset, read_len);
         _do_write_data(txc, c, o, gc_start_offset, read_len, head_bl, &wctx);
       }
+      logger->inc(l_bluestore_gc);
       logger->inc(l_bluestore_gc_bytes, read_len);
     }
 
@@ -7898,6 +7900,7 @@ int BlueStore::_do_write(
         o->extent_map.fault_range(db, end, read_len);
         _do_write_data(txc, c, o, end, read_len, tail_bl, &wctx);
       }
+      logger->inc(l_bluestore_gc);
       logger->inc(l_bluestore_gc_bytes, read_len);
     }
   }
index 8be28c2cacb3d441bd8200e3a76ec28498985992..0bfc7d75a8f8a4e0215d7b7c0538835f7520365c 100644 (file)
@@ -92,6 +92,7 @@ enum {
   l_bluestore_write_small_new,
   l_bluestore_txc,
   l_bluestore_onode_reshard,
+  l_bluestore_gc,
   l_bluestore_gc_bytes,
   l_bluestore_last
 };