diff options
author | Casey Bodley <cbodley@redhat.com> | 2019-02-28 20:16:54 +0100 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2019-03-01 18:54:15 +0100 |
commit | d611fe9954d234ae15345cc99eb705ecbb03964f (patch) | |
tree | 99123cea83b17c14af09e58bc56d9b3540972ec3 /src/rgw/rgw_sync_counters.cc | |
parent | rgw: zone service tracks source zones in a vector (diff) | |
download | ceph-d611fe9954d234ae15345cc99eb705ecbb03964f.tar.xz ceph-d611fe9954d234ae15345cc99eb705ecbb03964f.zip |
rgw: add perf counter definitions for multisite sync
Fixes: http://tracker.ceph.com/issues/38549
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/rgw_sync_counters.cc')
-rw-r--r-- | src/rgw/rgw_sync_counters.cc | 28 |
1 files changed, 28 insertions, 0 deletions
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 |