From 29d8ac8b1bb8127a52f4116720c2161ccd2f8689 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 28 Feb 2021 20:23:34 +0300 Subject: [PATCH] Do not report statistics for the empty operation --- src/osd_cluster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd_cluster.cpp b/src/osd_cluster.cpp index 88f3acfb..eac39d52 100644 --- a/src/osd_cluster.cpp +++ b/src/osd_cluster.cpp @@ -142,7 +142,7 @@ json11::Json osd_t::get_statistics() } st["host"] = self_state["host"]; json11::Json::object op_stats, subop_stats; - for (int i = 0; i <= OSD_OP_MAX; i++) + for (int i = OSD_OP_MIN; i <= OSD_OP_MAX; i++) { op_stats[osd_op_names[i]] = json11::Json::object { { "count", c_cli.stats.op_stat_count[i] }, @@ -150,7 +150,7 @@ json11::Json osd_t::get_statistics() { "bytes", c_cli.stats.op_stat_bytes[i] }, }; } - for (int i = 0; i <= OSD_OP_MAX; i++) + for (int i = OSD_OP_MIN; i <= OSD_OP_MAX; i++) { subop_stats[osd_op_names[i]] = json11::Json::object { { "count", c_cli.stats.subop_stat_count[i] },