]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/rgw_perf_counters.cc
import 15.2.5
[ceph.git] / ceph / src / rgw / rgw_perf_counters.cc
CommitLineData
11fdf7f2 1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
9f95a23c 2// vim: ts=8 sw=2 smarttab ft=cpp
11fdf7f2
TL
3
4#include "rgw_perf_counters.h"
5#include "common/perf_counters.h"
6#include "common/ceph_context.h"
7
8PerfCounters *perfcounter = NULL;
9
10int rgw_perf_start(CephContext *cct)
11{
12 PerfCountersBuilder plb(cct, "rgw", l_rgw_first, l_rgw_last);
13
14 // RGW emits comparatively few metrics, so let's be generous
15 // and mark them all USEFUL to get transmission to ceph-mgr by default.
16 plb.set_prio_default(PerfCountersBuilder::PRIO_USEFUL);
17
18 plb.add_u64_counter(l_rgw_req, "req", "Requests");
19 plb.add_u64_counter(l_rgw_failed_req, "failed_req", "Aborted requests");
20
21 plb.add_u64_counter(l_rgw_get, "get", "Gets");
22 plb.add_u64_counter(l_rgw_get_b, "get_b", "Size of gets");
23 plb.add_time_avg(l_rgw_get_lat, "get_initial_lat", "Get latency");
24 plb.add_u64_counter(l_rgw_put, "put", "Puts");
25 plb.add_u64_counter(l_rgw_put_b, "put_b", "Size of puts");
26 plb.add_time_avg(l_rgw_put_lat, "put_initial_lat", "Put latency");
27
28 plb.add_u64(l_rgw_qlen, "qlen", "Queue length");
29 plb.add_u64(l_rgw_qactive, "qactive", "Active requests queue");
30
31 plb.add_u64_counter(l_rgw_cache_hit, "cache_hit", "Cache hits");
32 plb.add_u64_counter(l_rgw_cache_miss, "cache_miss", "Cache miss");
33
34 plb.add_u64_counter(l_rgw_keystone_token_cache_hit, "keystone_token_cache_hit", "Keystone token cache hits");
35 plb.add_u64_counter(l_rgw_keystone_token_cache_miss, "keystone_token_cache_miss", "Keystone token cache miss");
36
494da23a 37 plb.add_u64_counter(l_rgw_gc_retire, "gc_retire_object", "GC object retires");
f6b5b4d7
TL
38
39 plb.add_u64_counter(l_rgw_lc_expire_current, "lc_expire_current",
40 "Lifecycle current expiration");
41 plb.add_u64_counter(l_rgw_lc_expire_noncurrent, "lc_expire_noncurrent",
42 "Lifecycle non-current expiration");
43 plb.add_u64_counter(l_rgw_lc_expire_dm, "lc_expire_dm",
44 "Lifecycle delete-marker expiration");
45 plb.add_u64_counter(l_rgw_lc_transition_current, "lc_transition_current",
46 "Lifecycle current transition");
47 plb.add_u64_counter(l_rgw_lc_transition_noncurrent,
48 "lc_transition_noncurrent",
49 "Lifecycle non-current transition");
50 plb.add_u64_counter(l_rgw_lc_abort_mpu, "lc_abort_mpu",
51 "Lifecycle abort multipart upload");
494da23a 52
11fdf7f2
TL
53 plb.add_u64_counter(l_rgw_pubsub_event_triggered, "pubsub_event_triggered", "Pubsub events with at least one topic");
54 plb.add_u64_counter(l_rgw_pubsub_event_lost, "pubsub_event_lost", "Pubsub events lost");
55 plb.add_u64_counter(l_rgw_pubsub_store_ok, "pubsub_store_ok", "Pubsub events successfully stored");
56 plb.add_u64_counter(l_rgw_pubsub_store_fail, "pubsub_store_fail", "Pubsub events failed to be stored");
57 plb.add_u64(l_rgw_pubsub_events, "pubsub_events", "Pubsub events in store");
58 plb.add_u64_counter(l_rgw_pubsub_push_ok, "pubsub_push_ok", "Pubsub events pushed to an endpoint");
59 plb.add_u64_counter(l_rgw_pubsub_push_failed, "pubsub_push_failed", "Pubsub events failed to be pushed to an endpoint");
60 plb.add_u64(l_rgw_pubsub_push_pending, "pubsub_push_pending", "Pubsub events pending reply from endpoint");
eafe8130 61 plb.add_u64_counter(l_rgw_pubsub_missing_conf, "pubsub_missing_conf", "Pubsub events could not be handled because of missing configuration");
11fdf7f2
TL
62
63 perfcounter = plb.create_perf_counters();
64 cct->get_perfcounters_collection()->add(perfcounter);
65 return 0;
66}
67
68void rgw_perf_stop(CephContext *cct)
69{
70 ceph_assert(perfcounter);
71 cct->get_perfcounters_collection()->remove(perfcounter);
72 delete perfcounter;
73}
74