Permalink
Browse files

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

  • Loading branch information...
1 parent f452bfa commit 13787c9f26d62a9c20563fb58a6d333b67c65ffc @adamhjk committed Dec 13, 2007
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;
}

0 comments on commit 13787c9

Please sign in to comment.