]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/common/perf_counters_collection.h
a196302470754f96945fe7c91bc4c807f4b54e37
[ceph.git] / ceph / src / crimson / common / perf_counters_collection.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #pragma once
5
6 #include "common/perf_counters.h"
7 #include <seastar/core/sharded.hh>
8
9 using crimson::common::PerfCountersCollectionImpl;
10 namespace crimson::common {
11 class PerfCountersCollection: public seastar::sharded<PerfCountersCollection>
12 {
13 using ShardedPerfCountersCollection = seastar::sharded<PerfCountersCollection>;
14
15 private:
16 std::unique_ptr<PerfCountersCollectionImpl> perf_collection;
17 static ShardedPerfCountersCollection sharded_perf_coll;
18 friend PerfCountersCollection& local_perf_coll();
19 friend ShardedPerfCountersCollection& sharded_perf_coll();
20
21 public:
22 PerfCountersCollection();
23 ~PerfCountersCollection();
24 PerfCountersCollectionImpl* get_perf_collection();
25
26 };
27
28 inline PerfCountersCollection::ShardedPerfCountersCollection& sharded_perf_coll(){
29 return PerfCountersCollection::sharded_perf_coll;
30 }
31
32 inline PerfCountersCollection& local_perf_coll() {
33 return PerfCountersCollection::sharded_perf_coll.local();
34 }
35
36 }
37