2009-04-27 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm: Properly set task queue size for statistics. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1656 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c3cb427651
commit
d9fc074da9
|
@ -1,3 +1,9 @@
|
|||
2009-04-27 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/ProducerConsumerServer.pm,
|
||||
lib/PandoraFMS/Server.pm: Properly set task queue size for
|
||||
statistics.
|
||||
|
||||
2009-04-24 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Core.pm: Generate
|
||||
|
|
|
@ -110,7 +110,7 @@ sub data_producer ($$$$$) {
|
|||
my @tasks = &{$self->{'_producer'}}($self);
|
||||
|
||||
# Update queue size for statistics
|
||||
$self->setQueueSize ($#tasks);
|
||||
$self->setQueueSize (scalar @{$task_queue});
|
||||
|
||||
foreach my $task (@tasks) {
|
||||
$sem->down;
|
||||
|
|
|
@ -44,6 +44,9 @@ sub new ($$$;$) {
|
|||
_queue_size => 0,
|
||||
};
|
||||
|
||||
# Share variables that may be set from different threads
|
||||
share ($self->{'_queue_size'});
|
||||
|
||||
# Thread kill signal handler
|
||||
#$SIG{'KILL'} = sub {
|
||||
# threads->exit() if threads->can('exit');
|
||||
|
@ -97,7 +100,7 @@ sub getServerID ($) {
|
|||
########################################################################################
|
||||
sub setQueueSize ($$) {
|
||||
my ($self, $size) = @_;
|
||||
|
||||
|
||||
$self->{'_queue_size'} = $size;
|
||||
}
|
||||
|
||||
|
@ -232,7 +235,7 @@ sub stop ($) {
|
|||
eval {
|
||||
# Update server status
|
||||
pandora_update_server ($self->{'_pa_config'}, $self->{'_dbh'}, $self->{'_pa_config'}->{'servername'},
|
||||
0, $self->{'_server_type'});
|
||||
0, $self->{'_server_type'}, 0, 0);
|
||||
|
||||
# Generate an event
|
||||
$self->downEvent ();
|
||||
|
|
Loading…
Reference in New Issue