1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #include "rgw_perf_counters.h"
5 #include "common/perf_counters.h"
6 #include "common/ceph_context.h"
8 PerfCounters
*perfcounter
= NULL
;
10 int rgw_perf_start(CephContext
*cct
)
12 PerfCountersBuilder
plb(cct
, "rgw", l_rgw_first
, l_rgw_last
);
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
);
18 plb
.add_u64_counter(l_rgw_req
, "req", "Requests");
19 plb
.add_u64_counter(l_rgw_failed_req
, "failed_req", "Aborted requests");
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");
28 plb
.add_u64(l_rgw_qlen
, "qlen", "Queue length");
29 plb
.add_u64(l_rgw_qactive
, "qactive", "Active requests queue");
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");
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");
37 plb
.add_u64_counter(l_rgw_pubsub_event_triggered
, "pubsub_event_triggered", "Pubsub events with at least one topic");
38 plb
.add_u64_counter(l_rgw_pubsub_event_lost
, "pubsub_event_lost", "Pubsub events lost");
39 plb
.add_u64_counter(l_rgw_pubsub_store_ok
, "pubsub_store_ok", "Pubsub events successfully stored");
40 plb
.add_u64_counter(l_rgw_pubsub_store_fail
, "pubsub_store_fail", "Pubsub events failed to be stored");
41 plb
.add_u64(l_rgw_pubsub_events
, "pubsub_events", "Pubsub events in store");
42 plb
.add_u64_counter(l_rgw_pubsub_push_ok
, "pubsub_push_ok", "Pubsub events pushed to an endpoint");
43 plb
.add_u64_counter(l_rgw_pubsub_push_failed
, "pubsub_push_failed", "Pubsub events failed to be pushed to an endpoint");
44 plb
.add_u64(l_rgw_pubsub_push_pending
, "pubsub_push_pending", "Pubsub events pending reply from endpoint");
46 perfcounter
= plb
.create_perf_counters();
47 cct
->get_perfcounters_collection()->add(perfcounter
);
51 void rgw_perf_stop(CephContext
*cct
)
53 ceph_assert(perfcounter
);
54 cct
->get_perfcounters_collection()->remove(perfcounter
);