]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add perf counter to RGWListBucketIndexLogCR 26722/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 1 Mar 2019 16:23:23 +0000 (11:23 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 1 Mar 2019 17:54:21 +0000 (12:54 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc

index a8586d405884a3ff0dff17b5b8a3e23c7246cef4..ddcd4f83eea2a75ffeaa0bc91e9fcd3980c430b7 100644 (file)
@@ -2440,6 +2440,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,
@@ -2449,6 +2450,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" },
@@ -2458,7 +2462,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();