]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add perf counter to RGWListBucketIndexLogCR
authorCasey Bodley <cbodley@redhat.com>
Fri, 1 Mar 2019 16:23:23 +0000 (11:23 -0500)
committerCasey Bodley <cbodley@redhat.com>
Thu, 2 May 2019 12:45:25 +0000 (08:45 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d758457eb0ae6dff8d8356c35633786539ca90d7)

src/rgw/rgw_data_sync.cc

index f05fdc80ead713d58ed5c5da78b94c7460cd7456..ae51dea4c21e4802118f508ac9e81b44e8f45913 100644 (file)
@@ -2452,6 +2452,7 @@ class RGWListBucketIndexLogCR: public RGWCoroutine {
   string marker;
 
   list<rgw_bi_log_entry> *result;
+  std::optional<PerfGuard> 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<list<rgw_bi_log_entry> >(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();