Module: check_mk
Branch: master
Commit: 6aa4a181a94e4fa95623b5b5552e7474bdcb0421
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6aa4a181a94e4f…
Author: Óscar Nájera <on(a)mathias-kettner.de>
Date: Wed Nov 21 14:15:22 2018 +0100
6654 FIX Bug fixing in predictive levels and refactoring
Predictive levels calculations suffered from some buggy behaviors under
certain configuration conditions like: no predictions after 22:30,
inhability to fetch data despite months of available perf data, prediction
pointer offset by an hour in timezones with dayligth savings time.
- Document current behavior of get_rrd_data, add test for it, in case it is
ever modified.
- Since livestatus always replies, elevate exception of no data available
to data consolidation function. Should fix symptoms of [FEED-369]
- [CMK-1368] Fix integer division when estimating scale resolution. Now all
time resolutions are correctly mapped to the desired/available time range
- [FEED-3133] Fix predictive monitoring timezone issue
- Use JSON format to store and read prediction data aggregate & info. JSON
is 7x faster that ast.literal_eval and it is safer. Tuple data type is
lost, thus when comparing to parameters config a conversion needs to take
place.
- Functions in cmk_base/prediction are split in smaller more testable units
- Unit test for data processing functions in predictive levels
- Integration test for data retrieval & aggregation for predictive levels
- Include a sample rrd datafile to query historic data and expected
aggregation
- Remove repeated code between cmk_base/prediction & cmk/gui/prediction
Change-Id: I11b134f3d57e7867bba33fb1b926550eb0b489a8
---
.werks/6654 | 13 +
active_checks/check_cpu_peaks | 2 +-
cmk/gui/prediction.py | 119 ++------
cmk/prediction.py | 165 +++++++++++
cmk_base/prediction.py | 321 +++++++++------------
tests/integration/cmk_base/test-files/26 | 1 +
tests/integration/cmk_base/test-files/26.info | 1 +
.../integration/cmk_base/test-files/CPU_load.info | 3 +
tests/integration/cmk_base/test-files/CPU_load.rrd | Bin 0 -> 1151496 bytes
tests/integration/cmk_base/test-files/everyday | 1 +
.../integration/cmk_base/test-files/everyday.info | 1 +
tests/integration/cmk_base/test-files/thursday | 1 +
.../integration/cmk_base/test-files/thursday.info | 1 +
.../cmk_base/test_services_prediction.py | 121 ++++++++
tests/unit/cmk/test_prediction_commons.py | 61 ++++
tests/unit/cmk_base/test_prediction.py | 99 +++----
16 files changed, 566 insertions(+), 344 deletions(-)
Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=6aa4a181a9…