Module: check_mk
Branch: master
Commit: 62694989c41672c8f0b847e6e51a9abd38774394
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=62694989c41672…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 1 16:11:19 2018 +0200
CMK-671 Fixed mixup in event console status perfcounter columns
Change-Id: I745149fa0d0f5e4b485b3cca43ee8539093acf8a
---
cmk/ec/main.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index aab0ac2..6ed234f0 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -570,6 +570,7 @@ class Perfcounters(object):
"request": 0.95, # Client requests
}
+ # TODO: Why aren't self._times / self._rates / ... not initialized with their
defaults?
def __init__(self, logger):
super(Perfcounters, self).__init__()
self._lock = ECLock(logger)
@@ -620,6 +621,7 @@ class Perfcounters(object):
@classmethod
def status_columns(cls):
columns = []
+ # Please note: status_columns() and get_status() need to produce lists with exact
same column order
for name in cls._counter_names:
columns.append(("status_" + name, 0))
columns.append(("status_" + name.rstrip("s") +
"_rate", 0.0))
@@ -633,12 +635,13 @@ class Perfcounters(object):
def get_status(self):
with self._lock:
row = []
- for name, value in self._counters.iteritems():
- row.append(value)
+ # Please note: status_columns() and get_status() need to produce lists with
exact same column order
+ for name in self._counter_names:
+ row.append(self._counters[name])
row.append(self._rates.get(name, 0.0))
row.append(self._average_rates.get(name, 0.0))
- for name in self._weights.iterkeys():
+ for name in self._weights:
row.append(self._times.get(name, 0.0))
return row