Show small per-benchmark summaries in the graph index
authorJoachim Breitner <mail@joachim-breitner.de>
Fri, 29 May 2015 10:56:11 +0000 (12:56 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Fri, 29 May 2015 14:01:53 +0000 (16:01 +0200)
site/index.html
site/js/gipeda.js
src/GraphSummaries.hs

index 59036ef..9ef51f1 100644 (file)
@@ -57,7 +57,7 @@ html {
     border-collapse:collapse; 
     
 }
-.summary-row-collapsed + .summary-row td {
+.summary-table .summary-row-collapsed + .summary-row td {
     border-top: 4px dotted #DDD;
 
 }
@@ -230,13 +230,32 @@ html {
           </thead>
           <tbody>
            {{#each groupMembers}}
-            <tr>
-            <td class="benchmark-name">
-            {{this}}
-            <a class="graph-link" title="Graphs" href="{{graphLink this}}">
-             <span class="glyphicon glyphicon-signal"/>
-            </a>
-           </td>
+            <tr class="
+              summary-row
+              {{#with (lookup ../../graphSummaries this)}}
+               {{#if improvements}}summary-improvement{{/if}}
+               {{#if regressions}}summary-regression{{/if}}
+              {{/with}}
+              "
+            >
+             <td class="benchmark-name">
+              {{this}}
+              <a class="graph-link" title="Graphs" href="{{graphLink this}}">
+               <span class="glyphicon glyphicon-signal"/>
+              </a>
+             </td>
+             <td class="col-md-2 text-right">
+              {{#with (lookup ../../graphSummaries this)}}
+               <span>
+                {{improvements}}
+                <span class="glyphicon glyphicon-plus text-success"></span>
+               </span>
+               <span>
+                {{regressions}}
+                <span class="glyphicon glyphicon-minus text-warning"></span>
+               </span>
+              {{/with}}
+             </td>
             </tr>
            {{/each}}
           </tbody>
index 0f22ef9..b2e8c85 100644 (file)
@@ -36,7 +36,7 @@ var routes = {
         },
     graphIndex:
         { regex: /^graphs$/,
-          download: ['out/benchNames.json'],
+          download: ['out/benchNames.json', 'out/graph-summaries.json'],
           url: function () {return "graphs"},
         },
     revision:
@@ -234,6 +234,9 @@ function getJSON(url, callback, options) {
                $.each(jsonFetching[url], function (i,c) {c()});
                delete jsonFetching[url];
             },
+            error: function (e) {
+                console.log("Failure fetching "+url,e);
+            },
            cache: false,
             dataType: 'json',
         });
index faf006e..a4de0c3 100644 (file)
@@ -26,11 +26,9 @@ graphSummaries benchNames = do
                     results <- rev .: "benchResults"
                     result <- results .: T.pack bName
                     parseJSON result
-        return $ object [
-            T.pack bName .= object
+        return $ T.pack bName .= object
                 [ T.pack "improvements" .= length [ () | gp <- gps, gpChangeType gp == Improvement ]
                 , T.pack "regressions"  .= length [ () | gp <- gps, gpChangeType gp == Regression]
                 ]
-            ]
-    let o = object [ "graphSummaries" .= merges g ]
+    let o = object [ "graphSummaries" .= object g ]
     BS.putStr $ encode o