Helios/MetajobBurstService.pm

filter: Statementstmt 68.4% 13 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 66.6% 18 / 27 CC 2 SCAR 9.8
CC
2
Cov
62%
burstJob
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« Helios/Job.pm ↑ Summary Helios/Logger.pm »
1 package Helios::MetajobBurstService;
2  
3 1 ▶use 5.008000;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use base qw( Helios::Service );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '2.83';
9  
10 # CHANGE HISTORY:
11 # [LH] [2015-08-14]: Changed all CRLF endings to Unix-style LF endings.
12  
13 =head1 NAME
14  
15 Helios::MetajobBurstService - base class for metajob burst services in Helios
16  
17 =head1 DESCRIPTION
18  
19 Helios::MetajobBurstService is a subclass of Helios::Service specially tasked with bursting
20 metajobs. You can subclass this class to provide special metajob bursters for your application.
21 This allows you more fine grained control over the volume of jobs entering the Helios job queue.
22  
23 A MetajobBurstService class supports one config parameter, burst_interval, which is the
24 number of seconds between metajob bursts. This is to prevent the metajob bursting process from
25 running so fast the Helios job queue is overwhelmed with burst jobs.
26  
27 =cut
28  
29 =head1
30  
31 =cut
32  
33 0 ▶sub burstJob {
Subroutine burstJob: not called CC=2 SCAR=17.9
Pod documented
34 0 my $self = shift;
35 0 my $config = $self->getConfig();
36 0 my $jobnumber = $self->SUPER::burstJob(@_);
37 0 ▶ if ( defined($config->{burst_interval}) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $config->{"burst_interval"}) 0 0 0
38 0 sleep $config->{burst_interval};
39 }
40 0 return $jobnumber;
41 }
42  
43  
44 1 1;
45 __END__
« Helios/Job.pm ↑ Summary Helios/Logger.pm »