diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/rgw/rgw_perf_counters.cc | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/rgw/rgw_perf_counters.cc')
-rw-r--r-- | src/rgw/rgw_perf_counters.cc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/rgw/rgw_perf_counters.cc b/src/rgw/rgw_perf_counters.cc new file mode 100644 index 00000000..21d1a363 --- /dev/null +++ b/src/rgw/rgw_perf_counters.cc @@ -0,0 +1,60 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#include "rgw_perf_counters.h" +#include "common/perf_counters.h" +#include "common/ceph_context.h" + +PerfCounters *perfcounter = NULL; + +int rgw_perf_start(CephContext *cct) +{ + PerfCountersBuilder plb(cct, "rgw", l_rgw_first, l_rgw_last); + + // RGW emits comparatively few metrics, so let's be generous + // and mark them all USEFUL to get transmission to ceph-mgr by default. + plb.set_prio_default(PerfCountersBuilder::PRIO_USEFUL); + + plb.add_u64_counter(l_rgw_req, "req", "Requests"); + plb.add_u64_counter(l_rgw_failed_req, "failed_req", "Aborted requests"); + + plb.add_u64_counter(l_rgw_get, "get", "Gets"); + plb.add_u64_counter(l_rgw_get_b, "get_b", "Size of gets"); + plb.add_time_avg(l_rgw_get_lat, "get_initial_lat", "Get latency"); + plb.add_u64_counter(l_rgw_put, "put", "Puts"); + plb.add_u64_counter(l_rgw_put_b, "put_b", "Size of puts"); + plb.add_time_avg(l_rgw_put_lat, "put_initial_lat", "Put latency"); + + plb.add_u64(l_rgw_qlen, "qlen", "Queue length"); + plb.add_u64(l_rgw_qactive, "qactive", "Active requests queue"); + + plb.add_u64_counter(l_rgw_cache_hit, "cache_hit", "Cache hits"); + plb.add_u64_counter(l_rgw_cache_miss, "cache_miss", "Cache miss"); + + plb.add_u64_counter(l_rgw_keystone_token_cache_hit, "keystone_token_cache_hit", "Keystone token cache hits"); + plb.add_u64_counter(l_rgw_keystone_token_cache_miss, "keystone_token_cache_miss", "Keystone token cache miss"); + + plb.add_u64_counter(l_rgw_gc_retire, "gc_retire_object", "GC object retires"); + + plb.add_u64_counter(l_rgw_pubsub_event_triggered, "pubsub_event_triggered", "Pubsub events with at least one topic"); + plb.add_u64_counter(l_rgw_pubsub_event_lost, "pubsub_event_lost", "Pubsub events lost"); + plb.add_u64_counter(l_rgw_pubsub_store_ok, "pubsub_store_ok", "Pubsub events successfully stored"); + plb.add_u64_counter(l_rgw_pubsub_store_fail, "pubsub_store_fail", "Pubsub events failed to be stored"); + plb.add_u64(l_rgw_pubsub_events, "pubsub_events", "Pubsub events in store"); + plb.add_u64_counter(l_rgw_pubsub_push_ok, "pubsub_push_ok", "Pubsub events pushed to an endpoint"); + plb.add_u64_counter(l_rgw_pubsub_push_failed, "pubsub_push_failed", "Pubsub events failed to be pushed to an endpoint"); + plb.add_u64(l_rgw_pubsub_push_pending, "pubsub_push_pending", "Pubsub events pending reply from endpoint"); + plb.add_u64_counter(l_rgw_pubsub_missing_conf, "pubsub_missing_conf", "Pubsub events could not be handled because of missing configuration"); + + perfcounter = plb.create_perf_counters(); + cct->get_perfcounters_collection()->add(perfcounter); + return 0; +} + +void rgw_perf_stop(CephContext *cct) +{ + ceph_assert(perfcounter); + cct->get_perfcounters_collection()->remove(perfcounter); + delete perfcounter; +} + |