]>
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 TL |
22 | void PerfCountersCollection::dump_formatted(ceph::Formatter *f, bool schema, |
23 | const std::string &logger, | |
24 | const std::string &counter) | |
25 | { | |
26 | perf_collection->dump_formatted(f, schema, logger, counter); | |
27 | } | |
28 | ||
11fdf7f2 TL |
29 | PerfCountersCollection::ShardedPerfCountersCollection PerfCountersCollection::sharded_perf_coll; |
30 | ||
20effc67 TL |
31 | void PerfCountersDeleter::operator()(PerfCounters* p) noexcept |
32 | { | |
33 | if (cct) { | |
34 | cct->get_perfcounters_collection()->remove(p); | |
35 | } | |
36 | delete p; | |
11fdf7f2 TL |
37 | } |
38 | ||
20effc67 | 39 | } |
11fdf7f2 | 40 |