]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add perf counter definitions for multisite sync
authorCasey Bodley <cbodley@redhat.com>
Thu, 28 Feb 2019 19:16:54 +0000 (14:16 -0500)
committerCasey Bodley <cbodley@redhat.com>
Thu, 2 May 2019 12:44:52 +0000 (08:44 -0400)
Fixes: http://tracker.ceph.com/issues/38549
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d611fe9954d234ae15345cc99eb705ecbb03964f)

src/rgw/CMakeLists.txt
src/rgw/rgw_sync_counters.cc [new file with mode: 0644]
src/rgw/rgw_sync_counters.h [new file with mode: 0644]

index 4f67e7b2d9760db9d7475e7afb457a2ca2416fe4..8d5b0638a0eb5614527f1111708be76a665eeb8a 100644 (file)
@@ -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 (file)
index 0000000..2a63d2c
--- /dev/null
@@ -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 (file)
index 0000000..4c27024
--- /dev/null
@@ -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