| 1 | package Devel::StatProfiler::Html; | ||||||||||||
| 2 | |||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 4 | ▶ | use Devel::StatProfiler::Report; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 2 | ▶ | sub process { | ||||||||||
|
Subroutine
process: called CC=5 SCAR=16.5
Pod
undocumented
| |||||||||||||
| 9 | 2 | my (%opts) = @_; | |||||||||||
| 10 | 2 | my $report = Devel::StatProfiler::Report->new( | |||||||||||
| 11 | flamegraph => 1, | ||||||||||||
| 12 | sources => 1, | ||||||||||||
| 13 | mixed_process => 1, | ||||||||||||
| 14 | ); | ||||||||||||
| 15 | |||||||||||||
| 16 | 2 | my %state; | |||||||||||
| 17 | 2 | for my $f (@{$opts{files}}) { | |||||||||||
| 18 | 6 | my $r = Devel::StatProfiler::Reader->new($f); | |||||||||||
| 19 | 6 | my ($process_id) = @{$r->get_genealogy_info}; | |||||||||||
| 20 | 6 | ▶ | if (my $process_state = $state{$process_id}) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 2 | $r->set_reader_state(delete $process_state->{reader_state}); | |||||||||||
| 22 | } | ||||||||||||
| 23 | eval { | ||||||||||||
| 24 | 6 | $report->add_trace_file($r); | |||||||||||
| 25 | |||||||||||||
| 26 | 6 | 1; | |||||||||||
| 27 | 6 | ▶ | } or do { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 28 | 0 | ▶ | my $error = $@ || "Zombie error"; | ||||||||||
|
Condition0%0/2
$@ || 'Zombie error'
MC/DC0%0/1
$@ || 'Zombie error'
$@
Truth table0%0/2
A
A= $@
| |||||||||||||
| 29 | |||||||||||||
| 30 | 0 | warn sprintf "Error reading trace file '%s': %s'", $f, $error; | |||||||||||
| 31 | }; | ||||||||||||
| 32 | 6 | $report->map_source($process_id); | |||||||||||
| 33 | 6 | $state{$process_id}->{reader_state} = $r->get_reader_state | |||||||||||
| 34 | } | ||||||||||||
| 35 | |||||||||||||
| 36 | 2 | return $report; | |||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | 0 | ▶ | sub process_and_output { | ||||||||||
|
Subroutine
process_and_output: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 40 | 0 | my (%opts) = @_; | |||||||||||
| 41 | 0 | my $report = process(%opts); | |||||||||||
| 42 | 0 | my $diagnostics = $report->output($opts{output}); | |||||||||||
| 43 | |||||||||||||
| 44 | 0 | for my $diagnostic (@$diagnostics) { | |||||||||||
| 45 | 0 | print STDERR $diagnostic, "\n"; | |||||||||||
| 46 | } | ||||||||||||
| 47 | } | ||||||||||||
| 48 | |||||||||||||
| 49 | 4 | 1; | |||||||||||
| 50 | |||||||||||||
| 51 | __END__ | ||||||||||||