From 6e43818edb9fd74ef15e422c9c18ed3833c5900e Mon Sep 17 00:00:00 2001 From: Rubab-Syed Date: Wed, 10 Jan 2018 04:32:42 +0500 Subject: [PATCH] mgr/dashboard: performance counter browsers Signed-off-by: Rubab-Syed (cherry picked from commit 25ecfbd9cfb620463de1545ca0be50001c805460) Conflicts: Removed dashboard changes --- src/pybind/mgr/mgr_module.py | 15 +++++++++++++++ src/pybind/mgr/prometheus/module.py | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index be4510265f9..38283d2446d 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -298,6 +298,21 @@ class MgrModule(ceph_module.BaseMgrModule): """ return self._ceph_get(data_name) + def _stattype_to_str(self, stattype): + + typeonly = stattype & self.PERFCOUNTER_TYPE_MASK + if typeonly == 0: + return 'gauge' + if typeonly == self.PERFCOUNTER_LONGRUNAVG: + # this lie matches the DaemonState decoding: only val, no counts + return 'counter' + if typeonly == self.PERFCOUNTER_COUNTER: + return 'counter' + if typeonly == self.PERFCOUNTER_HISTOGRAM: + return 'histogram' + + return '' + def get_server(self, hostname): """ Called by the plugin to load information about a particular diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 86f71133c36..c7daa128dd8 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -140,21 +140,6 @@ class Metrics(object): self.metrics[path] = metric - def _stattype_to_str(self, stattype): - - typeonly = stattype & self.PERFCOUNTER_TYPE_MASK - if typeonly == 0: - return 'gauge' - if typeonly == self.PERFCOUNTER_LONGRUNAVG: - # this lie matches the DaemonState decoding: only val, no counts - return 'counter' - if typeonly == self.PERFCOUNTER_COUNTER: - return 'counter' - if typeonly == self.PERFCOUNTER_HISTOGRAM: - return 'histogram' - - return '' - def _setup_static_metrics(self): metrics = {} metrics['health_status'] = Metric( -- 2.47.3