Skip to content

Commit

Permalink
Making each poll sleep for a bit randomly before pre-processing graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhjk committed Dec 13, 2007
1 parent f452bfa commit 13787c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/moonin-poller
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Log::Log4perl::init( \$conf );


my $nodes = {}; my $nodes = {};


srand;

sub log_method { sub log_method {
my ( $level, $msg ) = @_; my ( $level, $msg ) = @_;
my $DBG_MAP = { 0 => $INFO, 1 => $WARN, 2 => $ERROR }; my $DBG_MAP = { 0 => $INFO, 1 => $WARN, 2 => $ERROR };
Expand All @@ -39,6 +41,7 @@ sub dispatch {
my $logger = Log::Log4perl->get_logger("Moonin"); my $logger = Log::Log4perl->get_logger("Moonin");
$logger->info("Fetching node $domain $node"); $logger->info("Fetching node $domain $node");
$nodes->{$domain}->{$node}->{node}->process; $nodes->{$domain}->{$node}->{node}->process;
sleep(int(rand(60)));
$logger->info("Pre-Processing graphs for $domain $node"); $logger->info("Pre-Processing graphs for $domain $node");
$nodes->{$domain}->{$node}->{graph}->pre_process_all; $nodes->{$domain}->{$node}->{graph}->pre_process_all;
} }
Expand Down

0 comments on commit 13787c9

Please sign in to comment.