Skip to content
Snippets Groups Projects
Commit 82969ae4 authored by Jan Mach's avatar Jan Mach
Browse files

Added missing call for RRD chart generation into mentat-statistician.py module.

(Redmine issue: #3379)
parent c5e81274
No related branches found
No related tags found
No related merge requests found
......@@ -281,6 +281,8 @@ class MentatStatisticianScript(mentat.script.fetcher.FetcherScript):
self._update_rrds(result, time_high)
self._generate_charts(time_high)
result = mentat.stats.idea.brief_stats_full(result)
result = mentat.stats.idea.escape_stats_full(result)
......@@ -306,36 +308,52 @@ class MentatStatisticianScript(mentat.script.fetcher.FetcherScript):
rrds = self.stats_rrd.find_dbs()
try:
for itm in (('nodename', 'detectors'),
('nodesw', 'analyzers'),
('category', 'categories')):
total = 0
updated = {}
for itm in (('nodename', 'detectors'),
('nodesw', 'analyzers'),
('category', 'categories')):
total = 0
updated = {}
for (stat_key, stat_value) in stats[itm[1]].items():
for (stat_key, stat_value) in stats[itm[1]].items():
try:
db_name = self.stats_rrd.clean(stat_key)
self.logger.info("Updating RRD DB '{}.{}' statistics with value '{}' and timestamp '{}':'{}'".format(itm[0], stat_key, stat_value, str(tstamp), utstamp))
self._rrd_update_database(itm[0], stat_key, tstamp, stat_value)
updated[db_name] = 1
total += stat_value
except mentat.stats.rrd.RrdsUpdateException as exc:
self.logger.error(str(exc))
try:
self.logger.info("Updating RRD DB '{}.{}' total statistics with value '{}' and timestamp '{}':'{}'".format(itm[0], mentat.stats.rrd.DB_TOTALS_NAME, stat_value, str(tstamp), utstamp))
self._rrd_update_database(itm[0], mentat.stats.rrd.DB_TOTALS_NAME, tstamp, total)
updated[mentat.stats.rrd.DB_TOTALS_NAME] = 1
except mentat.stats.rrd.RrdsUpdateException as exc:
self.logger.error(str(exc))
if itm[0] not in rrds:
continue
if itm[0] not in rrds:
continue
for rrddb in rrds[itm[0]]:
if db_name in updated or db_name == mentat.stats.rrd.DB_TOTALS_NAME:
continue
for rrddb in rrds[itm[0]]:
if db_name in updated or db_name == mentat.stats.rrd.DB_TOTALS_NAME:
continue
try:
self.logger.info("Updating RRD DB '{}.{}' statistics with default value '0' and timestamp '{}':'{}'".format(itm[0], rrddb[2], str(tstamp), utstamp))
self._rrd_update_database(itm[0], rrddb[2], tstamp, 0)
except mentat.stats.rrd.RrdsUpdateException as exc:
self.logger.error(str(exc))
except mentat.stats.rrd.RrdsUpdateException as exc:
self.logger.error(str(exc))
def _generate_charts(self, tstamp):
"""
"""
utstamp = int(tstamp.timestamp())
result = self.stats_rrd.generate(utstamp)
self.runlog['generated_files'] = result
def _rrd_update_all(self, tstamp, value = 0):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment