Skip to content

Commit 2b66455

Browse files
authored
Merge pull request ceph#55950 from ifed01/wip-ifed-omap-pcounters
os/bluestore: add omap_set* perf counters Reviewed-by: [email protected] Reviewed-by: [email protected]
2 parents 88eddb2 + f216bc2 commit 2b66455

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/os/bluestore/BlueStore.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6326,10 +6326,21 @@ void BlueStore::_init_logger()
63266326
//****************************************
63276327
b.add_u64_counter(l_bluestore_omap_iterator_count, "omap_iterator_count",
63286328
"Open omap iterators count");
6329+
b.add_u64_counter(l_bluestore_omap_setheader_count, "omap_setheader_count",
6330+
"amount of omap setheader calls");
6331+
b.add_u64_counter(l_bluestore_omap_setheader_bytes, "omap_setheader_bytes",
6332+
"amount of bytes set by omap setheader calls");
6333+
b.add_u64_counter(l_bluestore_omap_setkeys_count, "omap_setkeys_count",
6334+
"amount of omap setkeys calls");
6335+
b.add_u64_counter(l_bluestore_omap_setkeys_records, "omap_setkeys_records",
6336+
"amount of keys set by omap setkeys calls");
6337+
b.add_u64_counter(l_bluestore_omap_setkeys_bytes, "omap_setkeys_bytes",
6338+
"amount of bytes set by omap setkeys calls");
63296339
b.add_u64_counter(l_bluestore_omap_rmkeys_count, "omap_rmkeys_count",
63306340
"amount of omap keys removed via rmkeys");
63316341
b.add_u64_counter(l_bluestore_omap_rmkey_ranges_count, "omap_rmkey_range_count",
63326342
"amount of omap key ranges removed via rmkeys");
6343+
63336344
//****************************************
63346345
// other client ops latencies
63356346
//****************************************
@@ -17230,6 +17241,8 @@ int BlueStore::_omap_setkeys(TransContext *txc,
1723017241
o->get_omap_key(string(), &final_key);
1723117242
size_t base_key_len = final_key.size();
1723217243
decode(num, p);
17244+
auto num0 = num;
17245+
uint64_t total_bytes = 0;
1723317246
while (num--) {
1723417247
string key;
1723517248
bufferlist value;
@@ -17240,7 +17253,11 @@ int BlueStore::_omap_setkeys(TransContext *txc,
1724017253
dout(20) << __func__ << " " << pretty_binary_string(final_key)
1724117254
<< " <- " << key << dendl;
1724217255
txc->t->set(prefix, final_key, value);
17256+
total_bytes += value.length();
1724317257
}
17258+
logger->inc(l_bluestore_omap_setkeys_count);
17259+
logger->inc(l_bluestore_omap_setkeys_records, num0);
17260+
logger->inc(l_bluestore_omap_setkeys_bytes, total_bytes);
1724417261
r = 0;
1724517262
dout(10) << __func__ << " " << c->cid << " " << o->oid << " = " << r << dendl;
1724617263
return r;
@@ -17273,6 +17290,8 @@ int BlueStore::_omap_setheader(TransContext *txc,
1727317290
const string& prefix = o->get_omap_prefix();
1727417291
o->get_omap_header(&key);
1727517292
txc->t->set(prefix, key, bl);
17293+
logger->inc(l_bluestore_omap_setheader_count);
17294+
logger->inc(l_bluestore_omap_setheader_bytes, bl.length());
1727617295
r = 0;
1727717296
dout(10) << __func__ << " " << c->cid << " " << o->oid << " = " << r << dendl;
1727817297
return r;

src/os/bluestore/BlueStore.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ enum {
194194
l_bluestore_omap_iterator_count,
195195
l_bluestore_omap_rmkeys_count,
196196
l_bluestore_omap_rmkey_ranges_count,
197+
l_bluestore_omap_setheader_count,
198+
l_bluestore_omap_setheader_bytes,
199+
l_bluestore_omap_setkeys_count,
200+
l_bluestore_omap_setkeys_records,
201+
l_bluestore_omap_setkeys_bytes,
197202
//****************************************
198203

199204
// other client ops latencies

0 commit comments

Comments
 (0)