Skip to content

Commit

Permalink
os/bluestore: add counter to trace number of garbage collection reads
Browse files Browse the repository at this point in the history
Signed-off-by: xie xingguo <[email protected]>
  • Loading branch information
xiexingguo committed Oct 9, 2016
1 parent 9d8f444 commit 70de098
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/os/bluestore/BlueStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 70de098

Please sign in to comment.