From bf5435409f2a1b0be0a07f13b8d7e5b9474be5ac Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 11 Jan 2019 09:13:45 +0000 Subject: [PATCH] mgr: change 'bytes' dynamic perf counters to COUNTER type (so they are of the same type as in static perf) Signed-off-by: Mykola Golub --- src/mgr/OSDPerfMetricTypes.cc | 4 ++-- src/osd/DynamicPerfStats.h | 3 --- src/pybind/mgr/prometheus/module.py | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/mgr/OSDPerfMetricTypes.cc b/src/mgr/OSDPerfMetricTypes.cc index 3d842edc1635..06f7081d9aa4 100644 --- a/src/mgr/OSDPerfMetricTypes.cc +++ b/src/mgr/OSDPerfMetricTypes.cc @@ -46,10 +46,10 @@ void PerformanceCounterDescriptor::pack_counter(const PerformanceCounter &c, case PerformanceCounterType::OPS: case PerformanceCounterType::WRITE_OPS: case PerformanceCounterType::READ_OPS: - break; case PerformanceCounterType::BYTES: case PerformanceCounterType::WRITE_BYTES: case PerformanceCounterType::READ_BYTES: + break; case PerformanceCounterType::LATENCY: case PerformanceCounterType::WRITE_LATENCY: case PerformanceCounterType::READ_LATENCY: @@ -68,10 +68,10 @@ void PerformanceCounterDescriptor::unpack_counter( case PerformanceCounterType::OPS: case PerformanceCounterType::WRITE_OPS: case PerformanceCounterType::READ_OPS: - break; case PerformanceCounterType::BYTES: case PerformanceCounterType::WRITE_BYTES: case PerformanceCounterType::READ_BYTES: + break; case PerformanceCounterType::LATENCY: case PerformanceCounterType::WRITE_LATENCY: case PerformanceCounterType::READ_LATENCY: diff --git a/src/osd/DynamicPerfStats.h b/src/osd/DynamicPerfStats.h index 694632c01eb5..e88b21c9dd04 100644 --- a/src/osd/DynamicPerfStats.h +++ b/src/osd/DynamicPerfStats.h @@ -78,18 +78,15 @@ public: return; case PerformanceCounterType::BYTES: c->first += inb + outb; - c->second++; return; case PerformanceCounterType::WRITE_BYTES: if (op.may_write() || op.may_cache()) { c->first += inb; - c->second++; } return; case PerformanceCounterType::READ_BYTES: if (op.may_read()) { c->first += outb; - c->second++; } return; case PerformanceCounterType::LATENCY: diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index ef6c08492db4..7fb03580a24a 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -179,9 +179,9 @@ class Module(MgrModule): 'desc' : 'RBD image writes count'}, 'read_ops' : {'type' : self.PERFCOUNTER_COUNTER, 'desc' : 'RBD image reads count'}, - 'write_bytes' : {'type' : self.PERFCOUNTER_LONGRUNAVG, + 'write_bytes' : {'type' : self.PERFCOUNTER_COUNTER, 'desc' : 'RBD image bytes written'}, - 'read_bytes' : {'type' : self.PERFCOUNTER_LONGRUNAVG, + 'read_bytes' : {'type' : self.PERFCOUNTER_COUNTER, 'desc' : 'RBD image bytes read'}, 'write_latency' : {'type' : self.PERFCOUNTER_LONGRUNAVG, 'desc' : 'RBD image writes latency (msec)'}, -- 2.47.3