From: Casey Bodley Date: Thu, 28 Feb 2019 19:16:54 +0000 (-0500) Subject: rgw: add perf counter definitions for multisite sync X-Git-Tag: v14.2.2~129^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=552877237896c7a8a9973d80561e04c96d184b79;p=ceph.git rgw: add perf counter definitions for multisite sync Fixes: http://tracker.ceph.com/issues/38549 Signed-off-by: Casey Bodley (cherry picked from commit d611fe9954d234ae15345cc99eb705ecbb03964f) --- diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 4f67e7b2d97..8d5b0638a0e 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -61,6 +61,7 @@ set(librgw_common_srcs rgw_pubsub.cc rgw_sync.cc rgw_data_sync.cc + rgw_sync_counters.cc rgw_sync_module.cc rgw_sync_module_aws.cc rgw_sync_module_es.cc diff --git a/src/rgw/rgw_sync_counters.cc b/src/rgw/rgw_sync_counters.cc new file mode 100644 index 00000000000..2a63d2c1e9a --- /dev/null +++ b/src/rgw/rgw_sync_counters.cc @@ -0,0 +1,28 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#include "common/ceph_context.h" +#include "rgw_sync_counters.h" + +namespace sync_counters { + +PerfCountersRef build(CephContext *cct, const std::string& name) +{ + PerfCountersBuilder b(cct, name, l_first, l_last); + + // share these counters with ceph-mgr + b.set_prio_default(PerfCountersBuilder::PRIO_USEFUL); + + b.add_u64_avg(l_fetch, "fetch bytes", "Number of object bytes replicated"); + b.add_u64_counter(l_fetch_not_modified, "fetch not modified", "Number of objects already replicated"); + b.add_u64_counter(l_fetch_err, "fetch errors", "Number of object replication errors"); + + b.add_time_avg(l_poll, "poll latency", "Average latency of replication log requests"); + b.add_u64_counter(l_poll_err, "poll errors", "Number of replication log request errors"); + + auto logger = PerfCountersRef{ b.create_perf_counters(), cct }; + cct->get_perfcounters_collection()->add(logger.get()); + return logger; +} + +} // namespace sync_counters diff --git a/src/rgw/rgw_sync_counters.h b/src/rgw/rgw_sync_counters.h new file mode 100644 index 00000000000..4c27024186a --- /dev/null +++ b/src/rgw/rgw_sync_counters.h @@ -0,0 +1,25 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#pragma once + +#include "common/perf_counters_collection.h" + +namespace sync_counters { + +enum { + l_first = 805000, + + l_fetch, + l_fetch_not_modified, + l_fetch_err, + + l_poll, + l_poll_err, + + l_last, +}; + +PerfCountersRef build(CephContext *cct, const std::string& name); + +} // namespace sync_counters