Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Making each poll sleep for a bit randomly before pre-processing graphs

  • Loading branch information...
commit 13787c9f26d62a9c20563fb58a6d333b67c65ffc 1 parent f452bfa
@adamhjk authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  bin/moonin-poller
View
3  bin/moonin-poller
@@ -24,6 +24,8 @@ Log::Log4perl::init( \$conf );
my $nodes = {};
+srand;
+
sub log_method {
my ( $level, $msg ) = @_;
my $DBG_MAP = { 0 => $INFO, 1 => $WARN, 2 => $ERROR };
@@ -39,6 +41,7 @@ sub dispatch {
my $logger = Log::Log4perl->get_logger("Moonin");
$logger->info("Fetching node $domain $node");
$nodes->{$domain}->{$node}->{node}->process;
+ sleep(int(rand(60)));
$logger->info("Pre-Processing graphs for $domain $node");
$nodes->{$domain}->{$node}->{graph}->pre_process_all;
}
Please sign in to comment.
Something went wrong with that request. Please try again.