~joetalbott/uci-engine/user_auth

« back to all changes in this revision

Viewing changes to nf-stats-service/web_static/graphs/app_startup_benchmark.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
// This is a subtractor factory, that is, a function that returns a function
 
3
// that does subtraction.
 
4
function subtractory(minuend, subtrahend) {
 
5
    return function(item) {
 
6
        var difference = (item.data[0][minuend] - item.data[0][subtrahend]) / 1000000;
 
7
        return { id: item.id, date_entered: scope.dateParser(item.date_entered), delta: difference || 0 };
 
8
    }
 
9
}
 
10
 
 
11
scope.massageGraphData = function(blob) {
 
12
    scope.graphData = [
 
13
    {
 
14
        key: "Callback - Sent",
 
15
        values: blob.data.map(subtractory("upstart_app_launch:libual_start_message_callback",
 
16
                                          "upstart_app_launch:libual_start_message_sent"))
 
17
    },
 
18
    {
 
19
        key: "PreExec - Sent",
 
20
        values: blob.data.map(subtractory("upstart_app_launch:exec_pre_exec",
 
21
                                          "upstart_app_launch:libual_start_message_sent"))
 
22
    },
 
23
    {
 
24
        key: "Callback - PreExec",
 
25
        values: blob.data.map(subtractory("upstart_app_launch:libual_start_message_callback",
 
26
                                          "upstart_app_launch:exec_pre_exec"))
 
27
    }
 
28
    ];
 
29
}
 
30
</script>
 
31
 
 
32
<nvd3-line-chart
 
33
        data="graphData"
 
34
        id="app_startup_benchmark_graph"
 
35
        height="400"
 
36
        margin="{left:100,top:10,bottom:40,right:100}"
 
37
        x="accessor('item.date_entered')"
 
38
        y="accessor('item.delta')"
 
39
        useInteractiveGuideLine="true"
 
40
        tooltips="true"
 
41
        showXAxis="true"
 
42
        xAxisTickFormat="dateFormatter()"
 
43
        xAxisStaggerLabels="true"
 
44
        showYAxis="true"
 
45
        yAxisTickFormat="numberFormatter(',.2f', 'ms')"
 
46
        yAxisTickPadding="10"
 
47
        showLegend="true"
 
48
        showValues="true">
 
49
    <svg></svg>
 
50
</nvd3-line-chart>
 
51
 
 
52
<table>
 
53
    <tr>
 
54
        <td ng-repeat="series in graphData">
 
55
            <b>{{series.key}}</b>
 
56
            <dl ng-repeat="item in series.values">
 
57
                <dt>{{dateFormatter(ISO_ISH)(item.date_entered)}}</dt>
 
58
                <dd>Result: <b>{{item.delta}}s</b></dd>
 
59
            </dl>
 
60
        </td>
 
61
    </tr>
 
62
</table>