~joetalbott/uci-engine/user_auth

« back to all changes in this revision

Viewing changes to nf-stats-service/web_static/graphs/bootspeed.html

  • Committer: Thomi Richards
  • Date: 2014-06-27 20:02:44 UTC
  • mto: (629.2.9 nfss)
  • mto: This revision was merged to the branch mainline in revision 636.
  • Revision ID: thomi.richards@canonical.com-20140627200244-zi7dwxnyw38ypr2f
Initial version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<script type="text/javascript">
 
2
 
 
3
function isolator(key) {
 
4
    return function(item) {
 
5
        return { date_entered: scope.dateParser(item.date_entered),
 
6
            timespan: Math.max(item.data[key], 0) }
 
7
    }
 
8
}
 
9
 
 
10
scope.massageGraphData = function(blob) {
 
11
    scope.rawData = blob;
 
12
    scope.graphData = [
 
13
    {
 
14
        key: 'Kernel',
 
15
        values: blob.data.map(isolator('kernel'))
 
16
    },
 
17
    {
 
18
        key: 'Plumbing',
 
19
        values: blob.data.map(isolator('plumbing'))
 
20
    },
 
21
    {
 
22
        key: 'XOrg',
 
23
        values: blob.data.map(isolator('xorg'))
 
24
    },
 
25
    {
 
26
        key: 'Desktop',
 
27
        values: blob.data.map(isolator('desktop'))
 
28
//    },
 
29
//    {
 
30
//        key: 'Total Boot',
 
31
//        values: blob.data.map(isolator('boot'))
 
32
    }
 
33
    ];
 
34
}
 
35
</script>
 
36
 
 
37
<nvd3-stacked-area-chart
 
38
        data="graphData"
 
39
        id="bootspeed_graph"
 
40
        height="400"
 
41
        margin="{left:100,top:10,bottom:40,right:100}"
 
42
        x="accessor('item.date_entered')"
 
43
        y="accessor('item.timespan')"
 
44
        useInteractiveGuideLine="true"
 
45
        tooltips="true"
 
46
        showXAxis="true"
 
47
        xAxisTickFormat="dateFormatter()"
 
48
        xAxisStaggerLabels="true"
 
49
        showYAxis="true"
 
50
        yAxisTickFormat="numberFormatter(',.2f', 's')"
 
51
        yAxisTickPadding="10"
 
52
        showLegend="true"
 
53
        showValues="true">
 
54
    <svg></svg>
 
55
</nvd3-stacked-area-chart>
 
56
 
 
57
<table>
 
58
    <tr>
 
59
        <td ng-repeat="series in graphData">
 
60
            <b>{{series.key}}</b>
 
61
            <dl ng-repeat="item in series.values">
 
62
                <dt>{{dateFormatter(ISO_ISH)(item.date_entered)}}</dt>
 
63
                <dd>Result: <b>{{item.timespan}}s</b></dd>
 
64
            </dl>
 
65
        </td>
 
66
    </tr>
 
67
</table>