diff options
author | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2024-10-12 21:21:06 +0200 |
---|---|---|
committer | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2024-12-17 19:10:28 +0100 |
commit | d2531a0baf41428e07e6a79db0f6867f9a3cbd6f (patch) | |
tree | 23f2baac53fdad3a4944d7470f03a98203a019fc | |
parent | common/ceph_time: introduce time_guard for RAII-styled timediff calculation (diff) | |
download | ceph-d2531a0baf41428e07e6a79db0f6867f9a3cbd6f.tar.xz ceph-d2531a0baf41428e07e6a79db0f6867f9a3cbd6f.zip |
os/bluestore: bring latency logging to omap_iterate()
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
-rw-r--r-- | src/os/bluestore/BlueStore.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index ee5393f6608..6066c4c9213 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -13774,15 +13774,27 @@ int BlueStore::omap_iterate( { std::string key; o->get_omap_key(start_from.seek_position, &key); + auto start = ceph::mono_clock::now(); if (start_from.seek_type == omap_iter_seek_t::LOWER_BOUND) { it->lower_bound(key); + c->store->log_latency( + __func__, + l_bluestore_omap_lower_bound_lat, + ceph::mono_clock::now() - start, + c->store->cct->_conf->bluestore_log_omap_iterator_age); } else { it->upper_bound(key); + c->store->log_latency( + __func__, + l_bluestore_omap_upper_bound_lat, + ceph::mono_clock::now() - start, + c->store->cct->_conf->bluestore_log_omap_iterator_age); } } // iterate! std::string tail; + ceph::timespan next_lat_acc{0}; o->get_omap_tail(&tail); while (it->valid()) { std::string user_key; @@ -13795,12 +13807,17 @@ int BlueStore::omap_iterate( if (ret == omap_iter_ret_t::STOP) { break; } else if (ret == omap_iter_ret_t::NEXT) { + ceph::time_guard<ceph::mono_clock>{next_lat_acc}; it->next(); } else { ceph_abort(); } } - + c->store->log_latency( + __func__, + l_bluestore_omap_next_lat, + next_lat_acc, + c->store->cct->_conf->bluestore_log_omap_iterator_age); return 0; } |