From: Sridhar Seshasayee Date: Mon, 7 Apr 2025 11:03:07 +0000 (+0530) Subject: osd/scheduler/OpSchedulerItem: Fix calculation of recovery latency counters X-Git-Tag: testing/wip-vshankar-testing-20250603.055014-reef-debug~56^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=be1c15fe8fa9e1077ded70fceb8a7bea2b6f87ee;p=ceph-ci.git osd/scheduler/OpSchedulerItem: Fix calculation of recovery latency counters The patch fixes calculation of latency perf counters for the following objects: - PGRecovery - PGRecoveryContext and - PGRecoveryMsg Signed-off-by: Sridhar Seshasayee Fixes: https://tracker.ceph.com/issues/70811 (cherry picked from commit 9a246e4f22b470c96454d953738f359ebb8d2168) --- diff --git a/src/osd/scheduler/OpSchedulerItem.cc b/src/osd/scheduler/OpSchedulerItem.cc index d1abc264a8f..06b3cb5235d 100644 --- a/src/osd/scheduler/OpSchedulerItem.cc +++ b/src/osd/scheduler/OpSchedulerItem.cc @@ -217,7 +217,7 @@ void PGRecovery::run( { osd->logger->tinc( l_osd_recovery_queue_lat, - time_queued - ceph_clock_now()); + ceph_clock_now() - time_queued); osd->do_recovery(pg.get(), epoch_queued, reserved_pushes, priority, handle); pg->unlock(); } @@ -230,7 +230,7 @@ void PGRecoveryContext::run( { osd->logger->tinc( l_osd_recovery_context_queue_lat, - time_queued - ceph_clock_now()); + ceph_clock_now() - time_queued); c.release()->complete(handle); pg->unlock(); } @@ -250,7 +250,7 @@ void PGRecoveryMsg::run( PGRef& pg, ThreadPool::TPHandle &handle) { - auto latency = time_queued - ceph_clock_now(); + auto latency = ceph_clock_now() - time_queued; switch (op->get_req()->get_type()) { case MSG_OSD_PG_PUSH: osd->logger->tinc(l_osd_recovery_push_queue_lat, latency);