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.00';
9
10 =head1 NAME
11
12 Helios::MetajobBurstService - base class for metajob burst services in Helios
13
14 =head1 DESCRIPTION
15
16 Helios::MetajobBurstService is a subclass of Helios::Service specially tasked with bursting
17 metajobs. You can subclass this class to provide special metajob bursters for your application.
18 This allows you more fine grained control over the volume of jobs entering the Helios job queue.
19
20 A MetajobBurstService class supports one config parameter, burst_interval, which is the
21 number of seconds between metajob bursts. This is to prevent the metajob bursting process from
22 running so fast the Helios job queue is overwhelmed with burst jobs.
23
24 =cut
25
26 =head1
27
28 =cut
29
30 sub burstJob {
31 0 ▶ my $self = shift;
Subroutine burstJob: not called CC=2 SCAR=17.9
Pod documented
32 0 my $config = $self->getConfig();
33 0 my $jobnumber = $self->SUPER::burstJob(@_);
34 0 ▶ if ( defined($config->{burst_interval}) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $config->{"burst_interval"}) 0 0 0
35 0 sleep $config->{burst_interval};
36 }
37 0 return $jobnumber;
38 }
39
40
41 1 1;
42 __END__
« Helios/Job.pm ↑ Summary Helios/Logger.pm »