| 1 | # Declare our package | ||||||||||||||||||||||||||||||||||||||||||
| 2 | package POE::Devel::Benchmarker::Imager; | ||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | # Initialize our version | ||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use vars qw( $VERSION ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | $VERSION = '0.05'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | # auto-export the only sub we have | ||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use base qw( Exporter ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | our @EXPORT = qw( imager ); | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | # import the helper modules | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use YAML::Tiny; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | # load our plugins! | ||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use Module::Pluggable search_path => [ __PACKAGE__ ]; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | # load comparison stuff | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use version; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | # Get some stuff from Utils | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use POE::Devel::Benchmarker::Utils qw( currentTestVersion ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | # generate some accessors | ||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | use base qw( Class::Accessor::Fast ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | __PACKAGE__->mk_ro_accessors( qw( poe_versions poe_versions_sorted poe_loops data | |||||||||||||||||||||||||||||||||||||||||
| 28 | noxsqueue noasserts litetests quiet | ||||||||||||||||||||||||||||||||||||||||||
| 29 | ) ); | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | # autoflush, please! | ||||||||||||||||||||||||||||||||||||||||||
| 32 | 1 | ▶ | use IO::Handle; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 1 | STDOUT->autoflush( 1 ); | |||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | # starts the work of converting our data to images | ||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub imager { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
imager: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | my $options = shift; | |||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | # instantitate ourself | ||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | my $self = __PACKAGE__->new( $options ); | |||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | # parse all of our YAML modules! | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | $self->loadtests; | |||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | # process some stats | ||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | $self->process_data; | |||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | # generate the images! | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | $self->generate_images; | |||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | # creates a new instance | ||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | my $opts = shift; | |||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | # instantitate ourself | ||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | my $self = {}; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | bless $self, $class; | |||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | # init the options | ||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | $self->init_options( $opts ); | |||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if ( ! $self->{'options'}->{'quiet'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | print "[IMAGER] Starting up...\n"; | |||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | sub init_options { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init_options: not called CC=14 SCAR=53.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | my $options = shift; | |||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | # set defaults | ||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | $self->{'quiet'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | $self->{'litetests'} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | $self->{'noasserts'} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | $self->{'noxsqueue'} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | # process our options | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | if ( defined $options and ref $options and ref( $options ) eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $options and ref $options and ref $options eq "HASH"
defined $options and ref $options
MC/DC0%0/3
defined $options and ref $options and ref $options eq "HASH"
defined $options
ref $options
ref $options eq "HASH"
Truth table0%0/4
A and B and C
A= defined $optionsB= ref $optionsC= ref $options eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | # process quiet mode | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | if ( exists $options->{'quiet'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | if ( $options->{'quiet'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | $self->{'quiet'} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 89 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | $self->{'quiet'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | # process the LITE/HEAVY | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | if ( exists $options->{'litetests'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | if ( $options->{'litetests'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | $self->{'litetests'} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 98 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | $self->{'litetests'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | # process the noasserts to load | ||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | if ( exists $options->{'noasserts'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | if ( $options->{'noasserts'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | $self->{'noasserts'} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 107 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $self->{'noasserts'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||
| 112 | # process the noxsqueue to load | ||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | if ( exists $options->{'noxsqueue'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | if ( $options->{'noxsqueue'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | $self->{'noxsqueue'} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 116 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | $self->{'noxsqueue'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||
| 121 | # FIXME process the plugins to load -> "types" | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | # FIXME process the versions to load | ||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | # FIXME process the loops to load | ||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||
| 128 | # some sanity tests | ||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | if ( ! -d 'results' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | die "The 'results' directory is not found in the working directory!"; | |||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | if ( ! -d 'images' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | die "The 'images' directory is not found in the working directory!"; | |||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | # starts the process of loading all of our YAML images | ||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | ▶ | sub loadtests { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
loadtests: not called CC=18 SCAR=58.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | # gather all the YAML dumps | ||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | if ( opendir( DUMPS, 'results' ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | foreach my $d ( readdir( DUMPS ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 146 | # parse the file structure | ||||||||||||||||||||||||||||||||||||||||||
| 147 | # POE-1.0002-IO_Poll-LITE-assert-noxsqueue.yml | ||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | if ( $d =~ /^POE\-([\d\.\_]+)\-(\w+?)\-(LITE|HEAVY)\-(noassert|assert)\-(noxsqueue|xsqueue)\.yml$/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | my( $ver, $loop, $lite, $assert, $xsqueue ) = ( $1, $2, $3, $4, $5 ); | |||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | # skip this file? | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | if ( $self->noxsqueue ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | if ( $xsqueue eq 'xsqueue' ) { next } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 154 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | if ( defined $self->noxsqueue ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | if ( $xsqueue eq 'noxsqueue' ) { next } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | if ( $self->noasserts ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | if ( $assert eq 'assert' ) { next } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 161 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | if ( defined $self->noasserts ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | if ( $assert eq 'noassert' ) { next } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | if ( $self->litetests ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | if ( $lite eq 'HEAVY' ) { next } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | if ( $lite eq 'LITE' ) { next } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||
| 172 | # FIXME allow selective loading of tests, so we can control what to image, etc | ||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||
| 174 | # actually load this file! | ||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | $self->load_yaml( $d, $ver, $loop, $lite, $assert, $xsqueue ); | |||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | closedir( DUMPS ) or die "[IMAGER] Unable to read from 'results' -> " . $!; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 179 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | die "[IMAGER] Unable to open 'results' for reading -> " . $!; | |||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | # sanity | ||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | ▶ | if ( ! exists $self->{'data'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | die "[IMAGER] Unable to find valid POE test result(s) in the 'results' directory!\n"; | |||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | if ( ! $self->quiet ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | print "[IMAGER] Done with parsing the YAML files...\n"; | |||||||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | # loads the yaml of a specific file | ||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | sub load_yaml { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
load_yaml: not called CC=22 SCAR=62.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | my ( $self, $file, $ver, $loop, $lite, $assert, $xsqueue ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | my $yaml = YAML::Tiny->read( 'results/' . $file ); | |||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | if ( ! defined $yaml ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | print "[IMAGER] Unable to load YAML file $file -> " . YAML::Tiny->errstr . "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 203 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 204 | # inrospect it! | ||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | my $isvalid = 0; | |||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | eval { | |||||||||||||||||||||||||||||||||||||||||
| 207 | # simple sanity check: the "x_bench" param is at the end of the YML, so if it loads fine we know it's there | ||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | if ( defined $yaml->[0] and exists $yaml->[0]->{'x_bench'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $yaml->[0] and exists $yaml->[0]{"x_bench"}
MC/DC0%0/2
defined $yaml->[0] and exists $yaml->[0]{"x_bench"}
defined $yaml->[0]
exists $yaml->[0]{"x_bench"}
Truth table0%0/3
A and B
A= defined $yaml->[0]B= exists $yaml->[0]{"x_bench"}
| |||||||||||||||||||||||||||||||||||||||||||
| 209 | # version must at least match us | ||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | $isvalid = ( $yaml->[0]->{'x_bench'} eq currentTestVersion() ? 1 : 0 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 211 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | $isvalid = undef; | |||||||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||||||
| 214 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | if ( ! $isvalid or $@ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $isvalid or $@
MC/DC0%0/2
not $isvalid or $@
not $isvalid
$@
Truth table0%0/3
not(A) or B
A= not $isvalidB= $@
| |||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | print "[IMAGER] Detected outdated/corrupt benchmark result: $file"; | |||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 218 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 219 | # reduce indirection | ||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | $yaml = $yaml->[0]; | |||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||
| 224 | # store the POE version | ||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | $self->{'poe_versions'}->{ $ver } = 1; | |||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | # sanity check the loop master version ( which should always be our "installed" version, not per-POE ) | ||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | ▶ | if ( exists $yaml->{'poe'}->{'loop_m'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | if ( ! defined $self->{'poe_loops'}->{ $loop } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | $self->{'poe_loops'}->{ $loop } = $yaml->{'poe'}->{'loop_m'}; | |||||||||||||||||||||||||||||||||||||||||
| 231 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | if ( $self->{'poe_loops'}->{ $loop } ne $yaml->{'poe'}->{'loop_m'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 233 | die "[IMAGER] Detected POE::Loop master version inconsistency! $file reported '" . $yaml->{'poe'}->{'loop_m'} . | ||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | "' while others had '" . $self->{'poe_loops'}->{ $loop } . "'"; | |||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||
| 239 | # get the info we're interested in | ||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | $self->{'data'}->{ $assert }->{ $xsqueue }->{ $ver }->{ $loop }->{'metrics'} = $yaml->{'metrics'}; | |||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | $self->{'data'}->{ $assert }->{ $xsqueue }->{ $ver }->{ $loop }->{'time'} = $yaml->{'t'}; | |||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | ▶ | if ( exists $yaml->{'pid'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | $self->{'data'}->{ $assert }->{ $xsqueue }->{ $ver }->{ $loop }->{'pid'} = $yaml->{'pid'}; | |||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | ▶ | if ( exists $yaml->{'poe'}->{'modules'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | $self->{'data'}->{ $assert }->{ $xsqueue }->{ $ver }->{ $loop }->{'poe_modules'} = $yaml->{'poe'}->{'modules'}; | |||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||
| 250 | # sanity check the perl stuff | ||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | if ( exists $yaml->{'perl'}->{'binary'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | ▶ | if ( ! exists $self->{'data'}->{'perlconfig'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | $self->{'data'}->{'perlconfig'}->{'binary'} = $yaml->{'perl'}->{'binary'}; | |||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | $self->{'data'}->{'perlconfig'}->{'version'} = $yaml->{'perl'}->{'v'}; | |||||||||||||||||||||||||||||||||||||||||
| 255 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | ▶ | if ( $self->{'data'}->{'perlconfig'}->{'binary'} ne $yaml->{'perl'}->{'binary'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 257 | die "[IMAGER] Detected perl binary inconsistency! $file reported '" . $yaml->{'perl'}->{'binary'} . | ||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | "' while others had '" . $self->{'data'}->{'perlconfig'}->{'binary'} . "'"; | |||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | ▶ | if ( $self->{'data'}->{'perlconfig'}->{'version'} ne $yaml->{'perl'}->{'v'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 261 | die "[IMAGER] Detected perl version inconsistency! $file reported '" . $yaml->{'perl'}->{'v'} . | ||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | "' while others had '" . $self->{'data'}->{'perlconfig'}->{'version'} . "'"; | |||||||||||||||||||||||||||||||||||||||||
| 263 | } | ||||||||||||||||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||
| 267 | # sanity check the uname | ||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | ▶ | if ( exists $yaml->{'uname'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | ▶ | if ( ! exists $self->{'data'}->{'uname'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | $self->{'data'}->{'uname'} = $yaml->{'uname'}; | |||||||||||||||||||||||||||||||||||||||||
| 271 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | if ( $self->{'data'}->{'uname'} ne $yaml->{'uname'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 273 | die "[IMAGER] Detected system inconsistency! $file reported '" . $yaml->{'uname'} . | ||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | "' while others had '" . $self->{'data'}->{'uname'} . "'"; | |||||||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||||||||||||||
| 277 | } | ||||||||||||||||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||||||||||||||||
| 279 | # sanity check the cpu name | ||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | ▶ | if ( exists $yaml->{'cpu'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | ▶ | if ( ! exists $self->{'data'}->{'cpu'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | $self->{'data'}->{'cpu'} = $yaml->{'cpu'}; | |||||||||||||||||||||||||||||||||||||||||
| 283 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | if ( $self->{'data'}->{'cpu'}->{'name'} ne $yaml->{'cpu'}->{'name'} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 285 | die "[IMAGER] Detected system/cpu inconsistency! $file reported '" . $yaml->{'cpu'}->{'name'} . | ||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | "' while others had '" . $self->{'data'}->{'cpu'}->{'name'} . "'"; | |||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | sub process_data { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process_data: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||
| 297 | # sanitize the versions in an ordered loop | ||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | $self->{'poe_versions_sorted'} = [ map { $_->stringify } | |||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | sort { $a <=> $b } | |||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | map { version->new($_) } keys %{ $self->poe_versions } | |||||||||||||||||||||||||||||||||||||||||
| 301 | ]; | ||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | ▶ | if ( ! $self->quiet ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | print "[IMAGER] Done with processing the benchmark statistics...\n"; | |||||||||||||||||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | sub generate_images { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
generate_images: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||
| 313 | # load our plugins and let them have fun :) | ||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | foreach my $plugin ( $self->plugins ) { | |||||||||||||||||||||||||||||||||||||||||
| 315 | # actually load it! | ||||||||||||||||||||||||||||||||||||||||||
| 316 | ## no critic | ||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | eval "require $plugin"; | |||||||||||||||||||||||||||||||||||||||||
| 318 | ## use critic | ||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | ▶ | if ( $@ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | ▶ | if ( ! $self->quiet ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | print "[IMAGER] Unable to load plugin $plugin -> $@\n"; | |||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||
| 326 | # sanity checks | ||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | if ( $plugin->can( 'new' ) and $plugin->can( 'imager' ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$plugin->can("new") and $plugin->can("imager")
MC/DC0%0/2
$plugin->can("new") and $plugin->can("imager")
$plugin->can("new")
$plugin->can("imager")
Truth table0%0/3
A and B
A= $plugin->can("new")B= $plugin->can("imager")
| |||||||||||||||||||||||||||||||||||||||||||
| 328 | # FIXME did we want this plugin? | ||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||
| 330 | # create the plugin's home dir | ||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | my $homedir = $plugin; | |||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | ▶ | if ( $homedir =~ /\:\:(\w+)$/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | $homedir = $1; | |||||||||||||||||||||||||||||||||||||||||
| 334 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | die "barf"; | |||||||||||||||||||||||||||||||||||||||||
| 336 | } | ||||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | ▶ | if ( ! -d "images/$homedir" ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 338 | # create it! | ||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | ▶ | if ( ! mkdir( "images/$homedir" ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | die "[IMAGER] Unable to create plugin directory: $homedir"; | |||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||
| 344 | # Okay, get this plugin! | ||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | my $obj = $plugin->new( { 'dir' => "images/$homedir/" } ); | |||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | ▶ | if ( ! $self->quiet ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | print "[IMAGER] Processing the $plugin plugin...\n"; | |||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | $obj->imager( $self ); | |||||||||||||||||||||||||||||||||||||||||
| 352 | } | ||||||||||||||||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | ▶ | if ( ! $self->quiet ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 356 | 0 | print "[IMAGER] Done with generating images...\n"; | |||||||||||||||||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||||||||||||||||
| 362 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 363 | __END__ | ||||||||||||||||||||||||||||||||||||||||||