38 # include <dsn/service_api_c.h> 54 void init(
const char* section,
const char *name, dsn_perf_counter_type_t type,
const char *dsptr)
56 _h = dsn_perf_counter_create(section, name, type, dsptr);
62 dsn_perf_counter_remove(_h);
66 void increment() { dsn_perf_counter_increment(_h); }
67 void decrement() { dsn_perf_counter_decrement(_h); }
68 void add(uint64_t val) { dsn_perf_counter_add(_h, val); }
69 void set(uint64_t val) { dsn_perf_counter_set(_h, val); }
70 double get_value() {
return dsn_perf_counter_get_value(_h); }
71 uint64_t get_integer_value() {
return dsn_perf_counter_get_integer_value(_h); }
72 double get_percentile(dsn_perf_counter_percentile_type_t type) {
return dsn_perf_counter_get_percentile(_h, type); }
Definition: perf_counter_.h:46