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: v20.3.0~112^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9a246e4f22b470c96454d953738f359ebb8d2168;p=ceph.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 --- diff --git a/src/osd/scheduler/OpSchedulerItem.cc b/src/osd/scheduler/OpSchedulerItem.cc index 1a6434618884..9d680c1b95b7 100644 --- a/src/osd/scheduler/OpSchedulerItem.cc +++ b/src/osd/scheduler/OpSchedulerItem.cc @@ -181,7 +181,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(); } @@ -194,7 +194,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(); } @@ -214,7 +214,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);