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

src/rgw/rgw_data_sync.cc

index 1ec599038b953b35b42a1d70530e34e00d07f96c..f05fdc80ead713d58ed5c5da78b94c7460cd7456 100644 (file)
@@ -21,6 +21,7 @@
 #include "rgw_http_client.h"
 #include "rgw_bucket.h"
 #include "rgw_metadata.h"
+#include "rgw_sync_counters.h"
 #include "rgw_sync_module.h"
 #include "rgw_sync_log_trim.h"
 
@@ -258,6 +259,7 @@ class RGWReadRemoteDataLogShardCR : public RGWCoroutine {
   bool *truncated;
 
   read_remote_data_log_response response;
+  std::optional<PerfGuard> timer;
 
 public:
   RGWReadRemoteDataLogShardCR(RGWDataSyncEnv *_sync_env, int _shard_id,
@@ -291,18 +293,28 @@ public:
 
         init_new_io(http_op);
 
+        if (sync_env->counters) {
+          timer.emplace(sync_env->counters, sync_counters::l_poll);
+        }
         int ret = http_op->aio_read();
         if (ret < 0) {
           ldout(sync_env->cct, 0) << "ERROR: failed to read from " << p << dendl;
           log_error() << "failed to send http operation: " << http_op->to_str() << " ret=" << ret << std::endl;
+          if (sync_env->counters) {
+            sync_env->counters->inc(sync_counters::l_poll_err);
+          }
           return set_cr_error(ret);
         }
 
         return io_block(0);
       }
       yield {
+        timer.reset();
         int ret = http_op->wait(&response);
         if (ret < 0) {
+          if (sync_env->counters && ret != -ENOENT) {
+            sync_env->counters->inc(sync_counters::l_poll_err);
+          }
           return set_cr_error(ret);
         }
         entries->clear();