Devel-Module-Trace

 view release on metacpan or  search on metacpan

script/devel_module_trace_result_server  view on Meta::CPAN

sub _read_results {
    my($file) = @_;
    open(my $fh, '<', $file) or die("cannot open $file: $!");
    my $content = "";
    while(<$fh>) { $content .= $_; }
    close($fh);
    if($content !~ m/^\$VAR1/mx) {
        die("unknown result file format");
    }
    my($VAR1);
    ## no critic
    eval($content);
    ## use critic
    die($@) if($@);
    return($VAR1);
}

################################################################################

__DATA__
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Devel::Module::Trace</title>
    <link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
    <link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css" />
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <style type='text/css'>
      BODY {
        padding-top: 25px;
      }
      TABLE.table TD, TABLE.table TH {
        white-space: nowrap;
      }
      .node {
        white-space: nowrap;
        height: 13px;
        position: absolute;
        background: #5bc0de;
        line-height: 13px;
        font-size: x-small;
      }
      .node.direct {
        background: #4cae4c;
      }
      .node_border {
        position: absolute;
        border: 1px solid grey;
        border-radius: 2px;
      }
      .nodetooltip {
        text-align: left;
        white-space: nowrap;
      }
      .nodetooltip TD {
        maring-left: 2px;
        padding-right: 3px;
      }
      .legend {
        height: 20px;
        position: relative;
        margin-right: 5px;
        padding: 0 3px;
        border: 1px solid grey;
        top: -1px;
        border-radius: 2px;
      }
    </style>
  </head>
  <body>

<!-- Navigation -->
<a name="top"></a>
<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li><a href="#stats">Statistics</a></li>
        <li><a href="#timeline">Timeline</a></li>
        <li><a href="#slowest">Slowest Modules</a></li>
        <li><a href="#most-used">Most Used Modules</a></li>
      </ul>
    </div>
  </div>
</nav>


<div class="container">

<!-- Statistics -->
<a name="stats"></a>
<div class="page-header">
    <h1>Statistics</h1>
</div>
<p>
  Recorded [% timeline.size %] module loads from '[% script %]' at [% strftime("%c", start_time) %].<br />
  Found [% modules.keys.size %] uniq modules which took [% sprintf("%.5f", total_time) %] seconds to load in total.
</p>


<!-- Timeline -->
<a name="timeline"></a>
<div class="page-header">
    <h1>Timeline</h1>
</div>
<p>
  Show in which order the modules have been loaded. The width of the bars reflects the time which the module took to load.<br />
  The x position is the relative time from start. Hover over a bar to get more information.<br /><br />
  Legend: <span class="node direct legend">direct dependency</span><span class="node legend">indirect dependency</span><br />

  <div style="position: relative;">
  <div style="position: absolute; top: -8px; left: -3px;">0s</div>
  <div style="position: absolute; top: -8px; right: -3px;" id="endmark">1s</div>
  <div style="position: relative; border: 1px solid grey; top: 10px;" id="timeline"></div>
  </div>
</p>


<!-- Slowest Modules -->
<a name="slowest"></a>
<div class="page-header">
    <h1>Slowest Modules</h1>
</div>
<p>
  Lists the modules ordered by duration.<br />
  <table class="table" id="slowest-table">
  <tr>
    <th># Loaded</th>
    <th>Module</th>
    <th>Total Duration</th>
    <th>First used in</th>
  </tr>
  </table>
</p>


<!-- Most Used -->
<a name="most-used"></a>
<div class="page-header">
    <h1>Most Used Modules</h1>
</div>
<p>
  Lists the modules ordered by the times loaded.<br />
  <table class="table" id="most-table">
  <tr>
    <th># Loaded</th>
    <th>Module</th>
    <th>Total Duration</th>
    <th>First used in</th>
  </tr>
  </table>
</p>


</div>

<script type="text/javascript">
var slowest  = [% json_encode(slowest) %];
var most     = [% json_encode(most) %];
var modules  = [% json_encode(modules) %];
var filter   = [% json_encode(filter) %];
var timeline = [% json_encode(timeline) %];

/* redraw all dynamic tables and graphs */
function renew_all() {
    renew_timeline();
    renew_most_table();
    renew_slowest_table();
    $('[data-toggle="tooltip"]').tooltip({html: true});



( run in 0.576 second using v1.01-cache-2.11-cpan-df04353d9ac )