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 <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Oct 9, 2016
1 parent 9d8f444 commit 51cac04
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2560,48 +2560,50 @@ void BlueStore::_init_logger()
"Sum for original bytes that were compressed");

b.add_u64(l_bluestore_onodes, "bluestore_onodes",
"Number of onodes in cache");
"Number of onodes in cache");
b.add_u64(l_bluestore_onode_hits, "bluestore_onode_hits",
"Sum for onode-lookups hit in the cache");
b.add_u64(l_bluestore_onode_misses, "bluestore_onode_misses",
"Sum for onode-lookups missed in the cache");
b.add_u64(l_bluestore_extents, "bluestore_extents",
"Number of extents in cache");
"Number of extents in cache");
b.add_u64(l_bluestore_blobs, "bluestore_blobs",
"Number of blobs in cache");
"Number of blobs in cache");
b.add_u64(l_bluestore_buffers, "bluestore_buffers",
"Number of buffers in cache");
"Number of buffers in cache");
b.add_u64(l_bluestore_buffer_bytes, "bluestore_buffer_bytes",
"Number of buffer bytes in cache");
"Number of buffer bytes in cache");
b.add_u64(l_bluestore_buffer_hit_bytes, "bluestore_buffer_hit_bytes",
"Sum for bytes of read hit in the cache");
b.add_u64(l_bluestore_buffer_miss_bytes, "bluestore_buffer_miss_bytes",
"Sum for bytes of read missed in the cache");

b.add_u64(l_bluestore_write_big, "bluestore_write_big",
"Large min_alloc_size-aligned writes into fresh blobs");
"Large min_alloc_size-aligned writes into fresh blobs");
b.add_u64(l_bluestore_write_big_bytes, "bleustore_write_big_bytes",
"Large min_alloc_size-aligned writes into fresh blobs (bytes)");
"Large min_alloc_size-aligned writes into fresh blobs (bytes)");
b.add_u64(l_bluestore_write_big_blobs, "bleustore_write_big_blobs",
"Large min_alloc_size-aligned writes into fresh blobs (blobs)");
"Large min_alloc_size-aligned writes into fresh blobs (blobs)");
b.add_u64(l_bluestore_write_small, "bluestore_write_small",
"Small writes into existing or sparse small blobs");
"Small writes into existing or sparse small blobs");
b.add_u64(l_bluestore_write_small_bytes, "bluestore_write_small_bytes",
"Small writes into existing or sparse small blobs (bytes)");
"Small writes into existing or sparse small blobs (bytes)");
b.add_u64(l_bluestore_write_small_unused, "bluestore_write_small_unused",
"Small writes into unused portion of existing blob");
"Small writes into unused portion of existing blob");
b.add_u64(l_bluestore_write_small_wal, "bluestore_write_small_wal",
"Small overwrites using WAL");
"Small overwrites using WAL");
b.add_u64(l_bluestore_write_small_pre_read, "bluestore_write_small_pre_read",
"Small writes that required we read some data (possibly cached) to "
"fill out the block");
"Small writes that required we read some data (possibly cached) to "
"fill out the block");
b.add_u64(l_bluestore_write_small_new, "bluestore_write_small_new",
"Small write into new (sparse) blob");
"Small write into new (sparse) blob");

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_bytes, "bluestore_gc_bytes", "garbage collected bytes");
"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 +7884,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 +7901,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 51cac04

Please sign in to comment.