From: Casey Bodley Date: Fri, 1 Mar 2019 16:23:23 +0000 (-0500) Subject: rgw: add perf counter to RGWListBucketIndexLogCR X-Git-Tag: v14.2.2~129^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=af890e01ff7f3b72d681dc66fa44f0add264b4c4;p=ceph.git rgw: add perf counter to RGWListBucketIndexLogCR Signed-off-by: Casey Bodley (cherry picked from commit d758457eb0ae6dff8d8356c35633786539ca90d7) --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index f05fdc80ead7..ae51dea4c21e 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -2452,6 +2452,7 @@ class RGWListBucketIndexLogCR: public RGWCoroutine { string marker; list *result; + std::optional timer; public: RGWListBucketIndexLogCR(RGWDataSyncEnv *_sync_env, const rgw_bucket_shard& bs, @@ -2461,6 +2462,9 @@ public: int operate() override { reenter(this) { + if (sync_env->counters) { + timer.emplace(sync_env->counters, sync_counters::l_poll); + } yield { rgw_http_param_pair pairs[] = { { "bucket-instance", instance_key.c_str() }, { "format" , "json" }, @@ -2470,7 +2474,11 @@ public: call(new RGWReadRESTResourceCR >(sync_env->cct, sync_env->conn, sync_env->http_manager, "/admin/log", pairs, result)); } + timer.reset(); if (retcode < 0) { + if (sync_env->counters) { + sync_env->counters->inc(sync_counters::l_poll_err); + } return set_cr_error(retcode); } return set_cr_done();