Devel-StatProfiler
view release on metacpan or search on metacpan
share/file.tmpl view on Meta::CPAN
? my %variables = %{$_[0]};
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="statprofiler.css">
<? my ($name, $file_name) = @variables{qw(name file_name)}; ?>
<title>StatProfiler: <?= $file_name->($name) ?></title>
</head>
<body>
?= $variables{include}->('header', $_[0])
<div id="body-content">
<table>
<caption>File source code</caption>
<tr>
<th>Line</td>
<th>Exclusive</th>
<th>Inclusive</th>
<th>Code</th>
</tr>
<? my ($lines, $exclusive, $inclusive, $subs, $callees, $mapping) = @variables{qw(lines exclusive inclusive subs callees mapping)};
my ($sub_link, $sub_name, $file_link, $lookup_sub, $format_total_ratio, $format_ratio) = @variables{qw(sub_link sub_name file_link lookup_sub format_total_ratio format_ratio)};
my ($logical_line, $logical_file, $physical_end) = (1, undef, 1);
my $map_index = 0;
for my $line (1 .. $#$lines) {
++$logical_line;
if ($line == $mapping->[$map_index][0]) {
my $entry = $mapping->[$map_index];
$logical_line = $line - $entry->[0] + $entry->[2];
$logical_file = $entry->[1];
++$map_index;
}
?>
<tr>
? if ($logical_file) {
<td><a name="L<?= $logical_file ?>-<?= $logical_line ?>"></a><?= $logical_line ?></td>
? } else {
<td><?= $logical_line ?></td>
? }
<td><?= $format_total_ratio->($exclusive->[$line], 'empty') ?></td>
<td><?= $format_total_ratio->($inclusive->[$line], 'empty') ?></td>
<td>
? if (my $starting_subs = $subs->{$line}) {
<div class="call-sites">
? for my $sub (@$starting_subs) {
<a name="S<?= $sub->{uq_name} =~ s/\W+/-/gr ?>"></a>
<?= $format_total_ratio->($sub->{inclusive}) ?> samples spent in <?= $sub->{name_pretty} ?><br />
? for my $site (sort {$a->{inclusive} <=> $b->{inclusive}} values %{$sub->{call_sites}}) {
<?= $format_ratio->($site->{exclusive}, $sub->{exclusive}) ?> (ex.),
<?= $format_ratio->($site->{inclusive}, $sub->{inclusive}) ?> (incl.)
when called from
<?= $sub_name->($lookup_sub->($site->{caller})->{name_pretty}) ?>
<a href="<?= $file_link->($site->{file}, $site->{line}) ?>">line <?= $site->{line} ?></a><br />
? }
? }
</div>
? }
? if (my $calls = $callees->{$line}) {
<div class="callees">
? for my $call (@$calls) {
( run in 2.147 seconds using v1.01-cache-2.11-cpan-acf6aa7dc9e )