Bencher/Formatter/CodeStartup.pm

filter: Statementstmt 67.5% 27 / 40 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 70.0% 7 / 10 Podpod 0.0% 0 / 1 totaltotal 50.0% 34 / 68 CC 9 SCAR 25.4
CC
9
Cov
50%
__ANON__
30.0
munge_result
12.0
__ANON__
12.0
CRAP 12.7
« Bencher/Formatter/DeleteConstantFields.pm ↑ Summary Bencher/Formatter/ModuleStartup.pm »
1 package Bencher::Formatter::CodeStartup;
2  
3 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use parent qw(Bencher::Formatter);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Role::Tiny::With;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 with 'Bencher::Role::FieldMunger';
11 1 with 'Bencher::Role::ResultMunger';
12  
13 1 ▶use Bencher::Backend;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use List::Util qw(first);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
17 1 our $DATE = '2023-07-08'; # DATE
18 1 our $DIST = 'Bencher-Backend'; # DIST
19 1 our $VERSION = '1.063'; # VERSION
20  
21 0 ▶sub munge_result {
Subroutine munge_result: not called CC=3 SCAR=24.8
Pod undocumented
22 0 my ($self, $envres) = @_;
23  
24 0 ▶ return unless $envres->[3]{'func.code_startup'};
Branch: 1 branch
BranchTrueFalseTotal
unless $envres->[3]{"func.code_startup"} 0 0 0
25 0 ▶ return unless @{$envres->[2]};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$envres->[2];} 0 0 0
26  
27 $self->add_field(
28 $envres,
29 'code_overhead_time',
30 {after=>'time', unit_of=>'time', align=>'number'},
31 0 ▶ sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
32 0 for my $rit (@{$envres->[2]}) {
33 0 ▶ my $rit_baseline = first {
Subroutine __ANON__: not called CC=5 SCAR=34.0
34 ($_->{participant} // '') eq 'perl -e1 (baseline)' &&
35 0 ▶ ($_->{perl} // '') eq ($rit->{perl} // '')
Branch: 1 branch
BranchTrueFalseTotal
($_->{"participant"} // "") eq "perl -e1 (baseline)" and ($_->{"perl"} // "") eq ($rit->{"perl"} // "") 0 0 0
Condition0%0/6
$_->{"participant"} // ""
l!l
00
$_->{"perl"} // ""
l!l
00
$rit->{"perl"} // ""
l!l
00
MC/DC0%0/1
$_->{"participant"} // ""
$_->{"participant"}
MC/DC0%0/1
$_->{"perl"} // ""
$_->{"perl"}
MC/DC0%0/1
$rit->{"perl"} // ""
$rit->{"perl"}
Truth table0%0/2
A
A= $_->{"participant"}
Aresult
11
00
Truth table0%0/2
A
A= $_->{"perl"}
Aresult
11
00
Truth table0%0/2
A
A= $rit->{"perl"}
Aresult
11
00
36 0 } @{ $envres->[2] };
37 0 ▶ next unless $rit_baseline;
Branch: 1 branch
BranchTrueFalseTotal
unless $rit_baseline 0 0 0
38  
39 $rit->{code_overhead_time} =
40 0 $rit->{time} - $rit_baseline->{time};
41 }
42 },
43 0 );
44  
45 0 $self->delete_fields(
46 $envres,
47 'dataset',
48 'rate',
49 );
50 }
51  
52 1 1;
53 # ABSTRACT: Munge code_startup results
54  
55 __END__
« Bencher/Formatter/DeleteConstantFields.pm ↑ Summary Bencher/Formatter/ModuleStartup.pm »