blob: 95e2a4f21156a05d5de44cb0b5155b63f15dff1c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#pragma once
#include "common/perf_counters.h"
#include <seastar/core/sharded.hh>
namespace ceph::common {
class PerfCountersCollection: public seastar::sharded<PerfCountersCollection>
{
using ShardedPerfCountersCollection = seastar::sharded<PerfCountersCollection>;
private:
std::unique_ptr<PerfCountersCollectionImpl> perf_collection;
static ShardedPerfCountersCollection sharded_perf_coll;
friend PerfCountersCollection& local_perf_coll();
friend ShardedPerfCountersCollection& sharded_perf_coll();
public:
PerfCountersCollection();
~PerfCountersCollection();
PerfCountersCollectionImpl* get_perf_collection();
};
inline PerfCountersCollection::ShardedPerfCountersCollection& sharded_perf_coll(){
return PerfCountersCollection::sharded_perf_coll;
}
inline PerfCountersCollection& local_perf_coll() {
return PerfCountersCollection::sharded_perf_coll.local();
}
}
|