Skip to content

Commit f216bc2

Browse files
committed
os/bluestore: add omap_set* perf counters
Signed-off-by: Igor Fedotov <[email protected]>
1 parent b11e6e2 commit f216bc2

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
//****************************************
@@ -17102,6 +17113,8 @@ int BlueStore::_omap_setkeys(TransContext *txc,
1710217113
o->get_omap_key(string(), &final_key);
1710317114
size_t base_key_len = final_key.size();
1710417115
decode(num, p);
17116+
auto num0 = num;
17117+
uint64_t total_bytes = 0;
1710517118
while (num--) {
1710617119
string key;
1710717120
bufferlist value;
@@ -17112,7 +17125,11 @@ int BlueStore::_omap_setkeys(TransContext *txc,
1711217125
dout(20) << __func__ << " " << pretty_binary_string(final_key)
1711317126
<< " <- " << key << dendl;
1711417127
txc->t->set(prefix, final_key, value);
17128+
total_bytes += value.length();
1711517129
}
17130+
logger->inc(l_bluestore_omap_setkeys_count);
17131+
logger->inc(l_bluestore_omap_setkeys_records, num0);
17132+
logger->inc(l_bluestore_omap_setkeys_bytes, total_bytes);
1711617133
r = 0;
1711717134
dout(10) << __func__ << " " << c->cid << " " << o->oid << " = " << r << dendl;
1711817135
return r;
@@ -17145,6 +17162,8 @@ int BlueStore::_omap_setheader(TransContext *txc,
1714517162
const string& prefix = o->get_omap_prefix();
1714617163
o->get_omap_header(&key);
1714717164
txc->t->set(prefix, key, bl);
17165+
logger->inc(l_bluestore_omap_setheader_count);
17166+
logger->inc(l_bluestore_omap_setheader_bytes, bl.length());
1714817167
r = 0;
1714917168
dout(10) << __func__ << " " << c->cid << " " << o->oid << " = " << r << dendl;
1715017169
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)