line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HPC::Runner::Command::stats::Logger::JSON::Long; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
380
|
use Moose::Role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
4129
|
use namespace::autoclean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
54
|
use JSON; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
82
|
use File::Slurp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
252
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub get_tasks { |
10
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
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
|
0
|
|
|
|
|
if ( -e $running_file ) { |
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
|
0
|
|
|
|
|
if ( -e $complete_file ) { |
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}) ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
push(@{$total_tasks}, $running->{$_}); |
|
0
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
foreach ( sort { $a <=> $b } keys(%{$complete}) ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
push(@{$total_tasks}, $complete->{$_}); |
|
0
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return $total_tasks; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |