Commits

Bryan O'Sullivan  committed b5b84b0

Make nicer with the reports.

  • Participants
  • Parent commits 5e1df0f

Comments (0)

Files changed (1)

File templates/report.tpl

 <html>
  <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>criterion report</title>
+    <title>pronk performance analysis</title>
     <!--[if lte IE 8]>
       <script language="javascript" type="text/javascript">
         {{#include}}js/excanvas-r3.min.js{{/include}}
  </head>
     <body>
       <div class="body">
-    <h1>pronk performance measurements</h1>
+    <h1>pronk performance analysis</h1>
 
 <h2><a name="b{{number}}">name</a></h2>
  <table width="100%">
              style="width:450px;height:278px;"></div></td>
   </tbody>
  </table>
- <table>
-  <thead class="analysis">
-   <th></th>
-   <th class="cibound"
-       title="{{anMean.estConfidenceLevel}} confidence level">lower bound</th>
-   <th>estimate</th>
-   <th class="cibound"
-       title="{{anMean.estConfidenceLevel}} confidence level">upper bound</th>
-  </thead>
-  <tbody>
-   <tr>
-    <td>Mean execution time</td>
-    <td><span class="citime">{{anMean.estLowerBound}}</span></td>
-    <td><span class="time">{{anMean.estPoint}}</span></td>
-    <td><span class="citime">{{anMean.estUpperBound}}</span></td>
-   </tr>
-   <tr>
-    <td>Standard deviation</td>
-    <td><span class="citime">{{anStdDev.estLowerBound}}</span></td>
-    <td><span class="time">{{anStdDev.estPoint}}</span></td>
-    <td><span class="citime">{{anStdDev.estUpperBound}}</span></td>
-   </tr>
-  </tbody>
- </table>
 
  <span class="outliers">
    <p>Outlying measurements have {{anOutlierVar.ovDesc}}
 
 <script type="text/javascript">
 $(function () {
-  function mangulate(number, name, mean, times, kdetimes, kdepdf) {
-    kdetimes = $.scaleTimes(kdetimes)[0];
+  function mangulate(number, name, mean, times, lats, kdetimes, kdepdf) {
     var meanSecs = mean;
-    mean *= $.timeUnits(mean)[0];
-    var ts = $.scaleTimes(times);
-    var units = ts[1];
-    ts = ts[0];
+    var units = $.timeUnits(mean);
+    var scale = units[0];
+    units = units[1];
+    mean *= scale;
+    kdetimes = $.scaleBy(scale, kdetimes);
+    lats = $.scaleBy(scale, lats);
     var kq = $("#kde" + number);
+    var xmin = Math.min(kdetimes[0], Math.min.apply(undefined, lats));
+    var xmax = Math.max(kdetimes[kdetimes.length-1], Math.max.apply(undefined, lats));
     var k = $.plot(kq,
-           [{ label: name + " latency densities (" + units + ")",
+           [{ label: name + " latency densities",
               data: $.zip(kdetimes, kdepdf),
               }],
-           { yaxis: { ticks: false },
+           { xaxis: { min: xmin, max: xmax,
+                      tickFormatter: $.unitFormatter(units) },
+             yaxis: { ticks: false },
              grid: { hoverable: true, markings: [ { color: '#6fd3fb',
                      lineWidth: 1.5, xaxis: { from: mean, to: mean } } ] },
            });
     kq.append('<div class="meanlegend" title="' + $.renderTime(meanSecs) +
               '" style="position:absolute;left:' + (o.left + 4) +
               'px;bottom:139px;">mean</div>');
-    var timepairs = new Array(ts.length);
-    for (var i = 0; i < ts.length; i++)
-      timepairs[i] = [ts[i],i];
     $.plot($("#time" + number),
-           [{ label: name + " latencies (" + units + ")",
-              data: timepairs }],
-           { points: { show: true },
+           [{ label: name + " latencies",
+              data: $.zip(lats, times) }],
+           { points: { show: true, radius: 2 },
              grid: { hoverable: true },
-             xaxis: { min: kdetimes[0], max: kdetimes[kdetimes.length-1] },
-             yaxis: { ticks: false },
+             xaxis: { min: xmin, max: xmax,
+                      tickFormatter: $.unitFormatter(units) },
+             yaxis: { min: 0, max: times[times.length-1],
+                      ticks: false,
+                      transform: function(v) { return -v; },
+                      inverseTransform: function(v) { return -v; } },
            });
     $.addTooltip("#kde" + number, function(x,y) { return x + ' ' + units; });
-    $.addTooltip("#time" + number, function(x,y) { return x + ' ' + units; });
+    $.addTooltip("#time" + number, function(x,y) {
+      return 'Latency at ' + $.renderTime(y) + ': ' + x + ' ' + units;
+    });
   };
   mangulate(0, "name",
             {{latency.mean}},
-            [{{#latValues}}{{summElapsed}},{{/latValues}}],
-            [{{#latKdeTimes}}{{x}},{{/latKdeTimes}}],
-            [{{#latKdePDF}}{{x}},{{/latKdePDF}}]);
+            /* start */ [{{#latValues}}{{summStart}},{{/latValues}}],
+            /* elapsed */ [{{#latValues}}{{summElapsed}},{{/latValues}}],
+            /* kde times */ [{{#latKdeTimes}}{{x}},{{/latKdeTimes}}],
+            /* kde pdf */ [{{#latKdePDF}}{{x}},{{/latKdePDF}}]);
 });
 $(document).ready(function () {
     $(".time").text(function(_, text) {