]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
20effc67 | 4 | #include "common/ceph_context.h" |
11fdf7f2 TL |
5 | #include "perf_counters_collection.h" |
6 | ||
9f95a23c | 7 | namespace crimson::common { |
11fdf7f2 TL |
8 | PerfCountersCollection::PerfCountersCollection() |
9 | { | |
10 | perf_collection = std::make_unique<PerfCountersCollectionImpl>(); | |
11 | } | |
12 | PerfCountersCollection::~PerfCountersCollection() | |
13 | { | |
14 | perf_collection->clear(); | |
15 | } | |
16 | ||
17 | PerfCountersCollectionImpl* PerfCountersCollection:: get_perf_collection() | |
18 | { | |
19 | return perf_collection.get(); | |
20 | } | |
21 | ||
20effc67 | 22 | void PerfCountersCollection::dump_formatted(ceph::Formatter *f, bool schema, |
1e59de90 | 23 | bool dump_labeled, |
20effc67 TL |
24 | const std::string &logger, |
25 | const std::string &counter) | |
26 | { | |
1e59de90 | 27 | perf_collection->dump_formatted(f, schema, dump_labeled, logger, counter); |
20effc67 TL |
28 | } |
29 | ||
11fdf7f2 TL |
30 | PerfCountersCollection::ShardedPerfCountersCollection PerfCountersCollection::sharded_perf_coll; |
31 | ||
20effc67 TL |
32 | void PerfCountersDeleter::operator()(PerfCounters* p) noexcept |
33 | { | |
34 | if (cct) { | |
35 | cct->get_perfcounters_collection()->remove(p); | |
36 | } | |
37 | delete p; | |
11fdf7f2 TL |
38 | } |
39 | ||
20effc67 | 40 | } |
11fdf7f2 | 41 |