- Added a basic status interface to spectre, for troubleshooting.
This commit is contained in:
parent
0ee42f1060
commit
f92fe7786d
2 changed files with 45 additions and 28 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
- Simplified Spectre's initial data load, and reduced memory footprint in the
|
- Simplified Spectre's initial data load, and reduced memory footprint in the
|
||||||
process.
|
process.
|
||||||
- fix: Spectre needs to be restarted every day
|
- fix: Spectre needs to be restarted every day
|
||||||
|
- Added a basic status interface to spectre, for troubleshooting.
|
||||||
- fix: lack of testing for valid object creation
|
- fix: lack of testing for valid object creation
|
||||||
- fix: No mention of intermediate upgrade step in gotcha's
|
- fix: No mention of intermediate upgrade step in gotcha's
|
||||||
- fix: A newly released version of Html::Template fixes a bug with global
|
- fix: A newly released version of Html::Template fixes a bug with global
|
||||||
|
|
|
||||||
|
|
@ -207,33 +207,6 @@ sub getLogger {
|
||||||
return $self->{_logger};
|
return $self->{_logger};
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
=head2 getRunningQueue ( )
|
|
||||||
|
|
||||||
Returns a reference to the queue of workflow instances that are running now.
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
sub getRunningQueue {
|
|
||||||
my $self = shift;
|
|
||||||
return $self->{_runningQueue};
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
=head2 getWaitingQueue ( )
|
|
||||||
|
|
||||||
Returns a reference to the queue of workflow instances waiting to run.
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
sub getWaitingQueue {
|
|
||||||
my $self = shift;
|
|
||||||
return $self->{_waitingQueue};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 getNextInstance ( )
|
=head2 getNextInstance ( )
|
||||||
|
|
@ -257,6 +230,49 @@ sub getNextInstance {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 getRunningQueue ( )
|
||||||
|
|
||||||
|
Returns a reference to the queue of workflow instances that are running now.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getRunningQueue {
|
||||||
|
my $self = shift;
|
||||||
|
return $self->{_runningQueue};
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 getStatus ( )
|
||||||
|
|
||||||
|
Returns a formatted text status report about the workflow engine.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getStatus {
|
||||||
|
my ($kernel, $request, $self) = @_[KERNEL,ARG0,OBJECT];
|
||||||
|
my $output = "Running Workflows: ".$self->getRunningQueue->get_item_count."\n";
|
||||||
|
$output .= "Workflows Waiting To Run: ".$self->getWaitingQueue->get_item_count."\n";
|
||||||
|
my ($data, $rsvp) = @$request;
|
||||||
|
$kernel->call(IKC=>post=>$rsvp,$output);
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 getWaitingQueue ( )
|
||||||
|
|
||||||
|
Returns a reference to the queue of workflow instances waiting to run.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getWaitingQueue {
|
||||||
|
my $self = shift;
|
||||||
|
return $self->{_waitingQueue};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 new ( config, logger, [ , debug ] )
|
=head2 new ( config, logger, [ , debug ] )
|
||||||
|
|
@ -284,7 +300,7 @@ sub new {
|
||||||
my $debug = shift;
|
my $debug = shift;
|
||||||
my $self = {_debug=>$debug, _config=>$config, _logger=>$logger};
|
my $self = {_debug=>$debug, _config=>$config, _logger=>$logger};
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
my @publicEvents = qw(addInstance deleteInstance);
|
my @publicEvents = qw(addInstance deleteInstance getStatus);
|
||||||
POE::Session->create(
|
POE::Session->create(
|
||||||
object_states => [ $self => [qw(_start _stop returnInstanceToRunnableState addInstance checkInstances deleteInstance suspendInstance runWorker workerResponse), @publicEvents] ],
|
object_states => [ $self => [qw(_start _stop returnInstanceToRunnableState addInstance checkInstances deleteInstance suspendInstance runWorker workerResponse), @publicEvents] ],
|
||||||
args=>[\@publicEvents]
|
args=>[\@publicEvents]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue