]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #include "rgw_perf_counters.h" | |
5 | #include "common/perf_counters.h" | |
6 | #include "common/ceph_context.h" | |
7 | ||
8 | PerfCounters *perfcounter = NULL; | |
9 | ||
10 | int 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 TL |
37 | plb.add_u64_counter(l_rgw_gc_retire, "gc_retire_object", "GC object retires"); |
38 | ||
11fdf7f2 TL |
39 | plb.add_u64_counter(l_rgw_pubsub_event_triggered, "pubsub_event_triggered", "Pubsub events with at least one topic"); |
40 | plb.add_u64_counter(l_rgw_pubsub_event_lost, "pubsub_event_lost", "Pubsub events lost"); | |
41 | plb.add_u64_counter(l_rgw_pubsub_store_ok, "pubsub_store_ok", "Pubsub events successfully stored"); | |
42 | plb.add_u64_counter(l_rgw_pubsub_store_fail, "pubsub_store_fail", "Pubsub events failed to be stored"); | |
43 | plb.add_u64(l_rgw_pubsub_events, "pubsub_events", "Pubsub events in store"); | |
44 | plb.add_u64_counter(l_rgw_pubsub_push_ok, "pubsub_push_ok", "Pubsub events pushed to an endpoint"); | |
45 | plb.add_u64_counter(l_rgw_pubsub_push_failed, "pubsub_push_failed", "Pubsub events failed to be pushed to an endpoint"); | |
46 | plb.add_u64(l_rgw_pubsub_push_pending, "pubsub_push_pending", "Pubsub events pending reply from endpoint"); | |
eafe8130 | 47 | plb.add_u64_counter(l_rgw_pubsub_missing_conf, "pubsub_missing_conf", "Pubsub events could not be handled because of missing configuration"); |
11fdf7f2 TL |
48 | |
49 | perfcounter = plb.create_perf_counters(); | |
50 | cct->get_perfcounters_collection()->add(perfcounter); | |
51 | return 0; | |
52 | } | |
53 | ||
54 | void rgw_perf_stop(CephContext *cct) | |
55 | { | |
56 | ceph_assert(perfcounter); | |
57 | cct->get_perfcounters_collection()->remove(perfcounter); | |
58 | delete perfcounter; | |
59 | } | |
60 |