}
}
+void PerfCounters::tinc(int idx, ceph::timespan amt)
+{
+ if (!m_cct->_conf->perf)
+ return;
+
+ assert(idx > m_lower_bound);
+ assert(idx < m_upper_bound);
+ perf_counter_data_any_d& data(m_data[idx - m_lower_bound - 1]);
+ if (!(data.type & PERFCOUNTER_TIME))
+ return;
+ if (data.type & PERFCOUNTER_LONGRUNAVG) {
+ data.avgcount.inc();
+ data.u64.add(amt.count());
+ data.avgcount2.inc();
+ } else {
+ data.u64.add(amt.count());
+ }
+}
+
void PerfCounters::tset(int idx, utime_t amt)
{
if (!m_cct->_conf->perf)
#include "common/Mutex.h"
#include "include/utime.h"
+#include "common/config_obs.h"
+#include "common/Mutex.h"
+#include "common/ceph_time.h"
+
#include <stdint.h>
#include <string>
#include <vector>
void tset(int idx, utime_t v);
void tinc(int idx, utime_t v);
+ void tinc(int idx, ceph::timespan v);
utime_t tget(int idx) const;
void reset();