Merge lp:~joetalbott/qa-dashboard/add_stddev_line into lp:qa-dashboard

Proposed by Joe Talbott
Status: Merged
Approved by: Chris Johnston
Approved revision: 182
Merged at revision: 182
Proposed branch: lp:~joetalbott/qa-dashboard/add_stddev_line
Merge into: lp:qa-dashboard
Diff against target: 127 lines (+28/-6)
2 files modified
bootspeed/api.py (+5/-0)
common/static/js/graph.js (+23/-6)
To merge this branch: bzr merge lp:~joetalbott/qa-dashboard/add_stddev_line
Reviewer Review Type Date Requested Status
Chris Johnston Approve
Review via email: mp+139818@code.launchpad.net

Commit message

Add standard deviation line to graphs

Description of the change

Add standard deviation line to graphs

To post a comment you must log in.
Revision history for this message
Chris Johnston (cjohnston) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bootspeed/api.py'
2--- bootspeed/api.py 2012-12-13 02:32:26 +0000
3+++ bootspeed/api.py 2012-12-14 00:00:27 +0000
4@@ -131,6 +131,7 @@
5 min=r.kernel_min,
6 max=r.kernel_max,
7 avg=r.kernel_avg,
8+ std=r.kernel_std,
9 build_number=r.image.build_number,
10 )
11 image_data.append(image_info)
12@@ -164,6 +165,7 @@
13 min=r.kernel_init_min,
14 max=r.kernel_init_max,
15 avg=r.kernel_init_avg,
16+ std=r.kernel_init_std,
17 build_number=r.image.build_number,
18 )
19 image_data.append(image_info)
20@@ -197,6 +199,7 @@
21 min=r.plumbing_min,
22 max=r.plumbing_max,
23 avg=r.plumbing_avg,
24+ std=r.plumbing_std,
25 build_number=r.image.build_number,
26 )
27 image_data.append(image_info)
28@@ -230,6 +233,7 @@
29 min=r.xorg_min,
30 max=r.xorg_max,
31 avg=r.xorg_avg,
32+ std=r.xorg_std,
33 build_number=r.image.build_number,
34 )
35 image_data.append(image_info)
36@@ -263,6 +267,7 @@
37 min=r.desktop_min,
38 max=r.desktop_max,
39 avg=r.desktop_avg,
40+ std=r.desktop_std,
41 build_number=r.image.build_number,
42 )
43 image_data.append(image_info)
44
45=== modified file 'common/static/js/graph.js'
46--- common/static/js/graph.js 2012-12-13 00:56:26 +0000
47+++ common/static/js/graph.js 2012-12-14 00:00:27 +0000
48@@ -26,8 +26,8 @@
49
50 var setCount = e.seriesCount;
51 console.log("setCount: ", setCount);
52- if (setCount != 4) {
53- throw "Exactly 4 values must be provided for error bar chart";
54+ if (setCount != 5) {
55+ throw "Exactly 5 values must be provided for error bar chart";
56 }
57
58 var speeds = [];
59@@ -46,11 +46,13 @@
60 min: sets[0][p].yval,
61 avg: sets[1][p].yval,
62 max: sets[2][p].yval,
63- release: sets[3][p].yval,
64+ std: sets[3][p].yval,
65+ release: sets[4][p].yval,
66 minY: sets[0][p].y,
67 avgY: sets[1][p].y,
68 maxY: sets[2][p].y,
69- releaseY: sets[3][p].y
70+ stdY: sets[3][p].y,
71+ releaseY: sets[4][p].y
72 };
73 speeds.push(speed);
74 }
75@@ -61,12 +63,16 @@
76
77 var HASH_WIDTH = 4;
78 var y_bottom = e.dygraph.toDomYCoord(0); // see http://dygraphs.com/jsdoc/symbols/Dygraph.html#toDomYCoord
79+
80+ var std_prev_x = 0;
81+ var std_prev_y = 0;
82 for (p = 0; p < speeds.length; p++) {
83
84 speed = speeds[p];
85 var topY = area.h * speed.maxY + area.y;
86 var bottomY = area.h * speed.minY + area.y;
87 var centerX = area.x + sets[0][p].x * area.w;
88+ var stdY = area.h * speed.stdY + area.y;
89
90 // Draw the bar first
91 var bodyY = area.h * speed.avgY + area.y;
92@@ -89,6 +95,17 @@
93 ctx.closePath();
94
95 ctx.stroke();
96+
97+ // Draw stddev line
98+ ctx.beginPath();
99+ ctx.moveTo(std_prev_x, std_prev_y);
100+ ctx.lineTo(centerX, stdY);
101+ ctx.closePath();
102+ // Store old values
103+ std_prev_x = centerX;
104+ std_prev_y = stdY;
105+ ctx.stroke();
106+
107 }
108 ctx.strokeStyle = 'rgba(0, 0, 0, 1.00)';
109 ctx.lineWidth = 1.0;
110@@ -148,7 +165,7 @@
111 for (x in bootspeedData.image_data) {
112 var record = bootspeedData.image_data[x];
113 var last_release_avg = bootspeedData.last_release_avg
114- values.push([x, record.min, record.avg, record.max, last_release_avg]);
115+ values.push([x, record.min, record.avg, record.max, record.std, last_release_avg]);
116 values_labels.push(record.build_number)
117 var last_release_name = bootspeedData.last_release_name
118 console.log("last_release_avg: " + last_release_avg);
119@@ -161,7 +178,7 @@
120 width: 700,
121 height: 500,
122 plotter: errorBarChartPlotter,
123- labels: ["x", "min", "avg", "max", last_release_name],
124+ labels: ["x", "min", "avg", "max", "std", last_release_name],
125 axisLabelFontSize: 12,
126 xAxisHeight: 80,
127 rightGap: 10,

Subscribers

People subscribed via source and target branches