Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Tapper/Producer/Temare.pm |
Statements | Executed 22 statements in 710µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 4.73ms | 16.1ms | BEGIN@12 | Tapper::Producer::Temare::
1 | 1 | 1 | 16µs | 80µs | BEGIN@13 | Tapper::Producer::Temare::
1 | 1 | 1 | 12µs | 4.54ms | BEGIN@11 | Tapper::Producer::Temare::
1 | 1 | 1 | 10µs | 10µs | BEGIN@3 | Tapper::Producer::Temare::
1 | 1 | 1 | 10µs | 34µs | BEGIN@23 | Tapper::Producer::Temare::
1 | 1 | 1 | 10µs | 46µs | BEGIN@15 | Tapper::Producer::Temare::
1 | 1 | 1 | 7µs | 7µs | BEGIN@14 | Tapper::Producer::Temare::
0 | 0 | 0 | 0s | 0s | __ANON__[:40] | Tapper::Producer::Temare::
0 | 0 | 0 | 0s | 0s | produce | Tapper::Producer::Temare::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | ## no critic (RequireUseStrict) | ||||
2 | package Tapper::Producer::Temare; | ||||
3 | # spent 10µs within Tapper::Producer::Temare::BEGIN@3 which was called:
# once (10µs+0s) by main::BEGIN@19 at line 5 | ||||
4 | 1 | 5µs | $Tapper::Producer::Temare::AUTHORITY = 'cpan:AMD'; | ||
5 | 1 | 26µs | 1 | 10µs | } # spent 10µs making 1 call to Tapper::Producer::Temare::BEGIN@3 |
6 | { | ||||
7 | 2 | 2µs | $Tapper::Producer::Temare::VERSION = '4.001.001'; | ||
8 | } | ||||
9 | # ABSTRACT: produce preconditions via temare | ||||
10 | |||||
11 | 3 | 66µs | 2 | 9.07ms | # spent 4.54ms (12µs+4.53) within Tapper::Producer::Temare::BEGIN@11 which was called:
# once (12µs+4.53ms) by main::BEGIN@19 at line 11 # spent 4.54ms making 1 call to Tapper::Producer::Temare::BEGIN@11
# spent 4.53ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:492] |
12 | 3 | 229µs | 2 | 23.8ms | # spent 16.1ms (4.73+11.4) within Tapper::Producer::Temare::BEGIN@12 which was called:
# once (4.73ms+11.4ms) by main::BEGIN@19 at line 12 # spent 16.1ms making 1 call to Tapper::Producer::Temare::BEGIN@12
# spent 7.61ms making 1 call to Exporter::import |
13 | 3 | 26µs | 2 | 144µs | # spent 80µs (16+64) within Tapper::Producer::Temare::BEGIN@13 which was called:
# once (16µs+64µs) by main::BEGIN@19 at line 13 # spent 80µs making 1 call to Tapper::Producer::Temare::BEGIN@13
# spent 64µs making 1 call to Exporter::import |
14 | 3 | 22µs | 1 | 7µs | # spent 7µs within Tapper::Producer::Temare::BEGIN@14 which was called:
# once (7µs+0s) by main::BEGIN@19 at line 14 # spent 7µs making 1 call to Tapper::Producer::Temare::BEGIN@14 |
15 | 3 | 59µs | 2 | 82µs | # spent 46µs (10+36) within Tapper::Producer::Temare::BEGIN@15 which was called:
# once (10µs+36µs) by main::BEGIN@19 at line 15 # spent 46µs making 1 call to Tapper::Producer::Temare::BEGIN@15
# spent 36µs making 1 call to Exporter::import |
16 | |||||
17 | |||||
18 | sub produce { | ||||
19 | my ($self, $job, $produce) = @_; | ||||
20 | |||||
21 | my ($fh, $file) = tempfile( UNLINK => 1 ); | ||||
22 | |||||
23 | 3 | 271µs | 2 | 57µs | # spent 34µs (10+23) within Tapper::Producer::Temare::BEGIN@23 which was called:
# once (10µs+23µs) by main::BEGIN@19 at line 23 # spent 34µs making 1 call to Tapper::Producer::Temare::BEGIN@23
# spent 23µs making 1 call to Exporter::import |
24 | my $temare_path=Tapper::Config->subconfig->{paths}{temare_path}; | ||||
25 | |||||
26 | $ENV{PYTHONPATH}="$temare_path/src"; | ||||
27 | my $subject = $produce->{subject}; | ||||
28 | my $bitness = $produce->{bitness}; | ||||
29 | my $host = $job->host->name; | ||||
30 | $ENV{TAPPER_TEMARE} = $file; | ||||
31 | my $cmd="$temare_path/temare subjectprep $host $subject $bitness"; | ||||
32 | my $precondition = qx($cmd); | ||||
33 | if ($?) { | ||||
34 | my $error_msg = "Temare error.\n"; | ||||
35 | $error_msg .= "Error code: $?\n"; | ||||
36 | $error_msg .= "Error message: $precondition\n"; | ||||
37 | die $error_msg; | ||||
38 | } | ||||
39 | |||||
40 | my $config = try {LoadFile($file)} catch { die "Error occured while loading precondition $precondition:\n$_"}; | ||||
41 | close $fh; | ||||
42 | unlink $file if -e $file; | ||||
43 | my $topic = $config->{subject} || 'Misc'; | ||||
44 | return { | ||||
45 | topic => $topic, | ||||
46 | precondition_yaml => $precondition | ||||
47 | }; | ||||
48 | } | ||||
49 | |||||
50 | 1 | 5µs | 1; | ||
51 | |||||
52 | __END__ |