Skip to content

Commit

Permalink
os/bluestore: measure op latency for data reformatting.
Browse files Browse the repository at this point in the history
Signed-off-by: Garry Drankovich <garry.drankovich@clyso.com>
  • Loading branch information
gardran committed Jun 19, 2024
1 parent 8aaf3dd commit d3f6930
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6433,6 +6433,9 @@ void BlueStore::_init_logger()

// reformatting counters
//****************************************
b.add_time_avg(l_bluestore_reformat_lat, "reformat_lat",
"Average reformatting latency",
"rf_l", PerfCountersBuilder::PRIO_CRITICAL);
b.add_u64_counter(l_bluestore_reformat_compress_attempted,
"reformat_compress_attempted",
"Recompression attempts done",
Expand Down Expand Up @@ -11852,9 +11855,18 @@ int BlueStore::read(
might_need_reformatting ? &span_stat : nullptr);
if (r == -EIO) {
logger->inc(l_bluestore_read_eio);
log_latency(__func__,
l_bluestore_read_lat,
mono_clock::now() - start,
cct->_conf->bluestore_log_op_age);
}
if (might_need_reformatting) {
auto start2 = mono_clock::now();
_maybe_reformat_object(c, o, offset, length, bl, op_flags, span_stat);
log_latency(__func__,
l_bluestore_reformat_lat,
mono_clock::now() - start2,
cct->_conf->bluestore_log_op_age);
}
}

Expand All @@ -11872,10 +11884,6 @@ int BlueStore::read(
dout(10) << __func__ << " " << cid << " " << oid
<< " 0x" << std::hex << offset << "~" << length << std::dec
<< " = " << r << dendl;
log_latency(__func__,
l_bluestore_read_lat,
mono_clock::now() - start,
cct->_conf->bluestore_log_op_age);
return r;
}

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 @@ -231,6 +231,7 @@ enum {

// reformatting counters
//****************************************
l_bluestore_reformat_lat,
l_bluestore_reformat_compress_attempted,
l_bluestore_reformat_compress_omitted,
l_bluestore_reformat_defragment_attempted,
Expand Down

0 comments on commit d3f6930

Please sign in to comment.