ceph perf counter 源码分析及使用
示例
1 enum {
2 test_perfcounter_first = 200,
3 test_perfcounter_count,
4 test_perfcounter_time,
5 test_perfcounter_sum,
6 test_perfcounter_last,
7 };
8
9 PerfCountersCollection *coll = g_ceph_context->get_perfcounters_collection();
10
11 PerfCountersBuilder test_plb(g_ceph_context, "test_perfcounter", test_perfcounter_first, test_perfcounter_last);
12
13 test_plb.add_u64_counter(test_perfcounter_count, "test_count");
14 test_plb.add_time(test_perfcounter_time, "test_time", "Time of system service");
15 test_plb.add_u64(test_perfcounter_sum, "test_sum", "Sum of variable", "wr_bytes_sum");
16
17 test_logger = test_plb.create_perf_counters();