Skip to content

Commit

Permalink
Properly set the poller for Recache Stats
Browse files Browse the repository at this point in the history
  • Loading branch information
cigamit committed Mar 10, 2019
1 parent 8e1f3df commit 3312d9e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data_templates.php
Expand Up @@ -487,7 +487,7 @@ function template_rrd_add() {

db_execute_prepared('INSERT IGNORE INTO data_template_rrd
(hash, data_template_id, rrd_maximum, rrd_minimum, rrd_heartbeat, data_source_type_id, data_source_name)
VALUES (?, ?, 0, 0, 600, 1, ?)', array($hash, get_request_var('id'), $dsname));
VALUES (?, ?, "U", 0, 600, 1, ?)', array($hash, get_request_var('id'), $dsname));

$data_template_rrd_id = db_fetch_insert_id();

Expand Down
2 changes: 1 addition & 1 deletion poller.php
Expand Up @@ -713,7 +713,7 @@ function sig_handler($signo) {
/* no re-index or Rechache present on this run
* in case, we have more PCOMMANDS than recaching, this has to be moved to poller_commands.php
* but then we'll have to call it each time to make sure, stats are updated */
set_config_option('stats_recache_' . $poller_id, 'RecacheTime:0.0 DevicesRecached:0');
set_config_option('stats_recache_' . $poller_id, 'Poller:' . $poller_id . ' RecacheTime:0.0 DevicesRecached:0');
}

if ($method == 'spine') {
Expand Down
2 changes: 1 addition & 1 deletion poller_commands.php
Expand Up @@ -172,7 +172,7 @@
/* take time to log performance data */
$recache = microtime(true);

$recache_stats = sprintf('Poller:%i RecacheTime:%01.4f DevicesRecached:%s', $poller_id, round($recache - $start, 4), $recached_hosts);
$recache_stats = sprintf('Poller:%s RecacheTime:%01.4f DevicesRecached:%s', $poller_id, round($recache - $start, 4), $recached_hosts);

if ($recached_hosts > 0) {
cacti_log('STATS: ' . $recache_stats, true, 'RECACHE');
Expand Down

0 comments on commit 3312d9e

Please sign in to comment.