From: Casey Bodley Date: Fri, 1 Mar 2019 16:11:13 +0000 (-0500) Subject: rgw: add perf counter to RGWReadRemoteDataLogShardCR X-Git-Tag: v14.2.2~129^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da81ae98e4f84fa320a7afcb396a505f51415a52;p=ceph.git rgw: add perf counter to RGWReadRemoteDataLogShardCR Signed-off-by: Casey Bodley (cherry picked from commit a515dccc5a79124acad67895955bc0eafb06d19a) --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 1ec599038b9..f05fdc80ead 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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 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();