blib/lib/HPC/Runner/Command/stats/Logger/JSON/Long.pm

filter: Statementstmt 34.2% 13 / 38 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 35.4% 17 / 48 CC 5 SCAR 28.4
CC
5
Cov
31%
get_tasks
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 17.1
« blib/lib/HPC/Runner/Command/submit_jobs/Utils/Scheduler/ResolveDeps/BuildTaskDeps.pm ↑ Summary blib/lib/HPC/Runner/Command/submit_jobs/Plugin/PBS.pm »
1 package HPC::Runner::Command::stats::Logger::JSON::Long;
2  
3 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Slurp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub get_tasks {
10 0 ▶ my $self = shift;
Subroutine get_tasks: not called CC=5 SCAR=34.0
Pod undocumented
11 0 my $submission_id = shift;
12 0 my $jobname = shift;
13  
14 ##Get the running tasks
15 0 my $running_file =
16 File::Spec->catdir( $self->data_dir, $jobname, 'running.json' );
17  
18 0 my $running = {};
19 0 ▶ if ( -e $running_file ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $running_file) 0 0 0
20 0 my $running_json = read_file($running_file);
21 0 $running = decode_json($running_json);
22 }
23  
24 0 my $complete = {};
25 0 my $complete_file =
26 File::Spec->catdir( $self->data_dir, $jobname, 'complete.json' );
27 0 ▶ if ( -e $complete_file ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $complete_file) 0 0 0
28 0 my $complete_json = read_file($complete_file);
29 0 $complete = decode_json($complete_json);
30 }
31  
32 0 my $total_tasks = [];
33 0 foreach ( sort { $a <=> $b } keys(%{$running}) ) {
34 0 push(@{$total_tasks}, $running->{$_});
35 }
36 0 foreach ( sort { $a <=> $b } keys(%{$complete}) ) {
37 0 push(@{$total_tasks}, $complete->{$_});
38 }
39  
40 0 return $total_tasks;
41 }
42  
43 1 1;
« blib/lib/HPC/Runner/Command/submit_jobs/Utils/Scheduler/ResolveDeps/BuildTaskDeps.pm ↑ Summary blib/lib/HPC/Runner/Command/submit_jobs/Plugin/PBS.pm »