current_op_seq_fn = sss.str();
// initialize perf_logger
- PerfCountersBuilder plb(g_ceph_context, internal_name, l_os_commit_lat, l_os_last);
+ PerfCountersBuilder plb(g_ceph_context, internal_name, l_os_commit_len, l_os_last);
plb.add_u64(l_os_oq_max_ops, "op_queue_max_ops");
plb.add_u64(l_os_oq_ops, "op_queue_ops");
plb.add_u64(l_os_oq_max_bytes, "op_queue_max_bytes");
plb.add_u64(l_os_oq_bytes, "op_queue_bytes");
plb.add_u64_counter(l_os_bytes, "bytes");
+ plb.add_time_avg(l_os_commit_lat, "commit_latency");
plb.add_time_avg(l_os_apply_lat, "apply_latency");
plb.add_time_avg(l_os_queue_lat, "queue_transaction_latency_avg");
utime_t lat = ceph_clock_now(g_ceph_context);
lat -= o->start;
+ perf_logger->tinc(l_os_commit_lat, lat);
perf_logger->tinc(l_os_apply_lat, lat);
if (o->onreadable_sync) {
class KeyValueStore : public ObjectStore,
public md_config_obs_t {
public:
+ struct KVPerfTracker {
+ PerfCounters::avg_tracker<uint64_t> os_commit_latency;
+ PerfCounters::avg_tracker<uint64_t> os_apply_latency;
+
+ objectstore_perf_stat_t get_cur_stats() const {
+ objectstore_perf_stat_t ret;
+ ret.filestore_commit_latency = os_commit_latency.avg();
+ ret.filestore_apply_latency = os_apply_latency.avg();
+ return ret;
+ }
+
+ void update_from_perfcounters(PerfCounters &logger) {
+ os_commit_latency.consume_next(
+ logger.get_tavg_ms(
+ l_os_commit_lat));
+ os_apply_latency.consume_next(
+ logger.get_tavg_ms(
+ l_os_apply_lat));
+ }
+
+ } perf_tracker;
+
objectstore_perf_stat_t get_cur_stats() {
- objectstore_perf_stat_t ret;
- return ret;
+ perf_tracker.update_from_perfcounters(*perf_logger);
+ return perf_tracker.get_cur_stats();
}
static const uint32_t target_version = 1;