Skip to content

Commit c972488

Browse files
author
Gabriel Loewen
authored
Merge pull request #1 from gabloe/master
Update from latest
2 parents 05afbf3 + 4c4d941 commit c972488

6 files changed

Lines changed: 164 additions & 214 deletions

File tree

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Generate the SQL structure using the following command:</br>
3838
python manage.py syncdb
3939
</code><br /><br />
4040
Step 5:<br />
41-
Start both nginx, and uwsgi services using the configurations found in the repo.<br /><br />
41+
Start both nginx, and uwsgi services using the configurations found in the repo. <b>Note:</b> nginx.conf needs to be copied to /etc/nginx/sites-enabled for the configuration to be loaded properly<br /><br />
4242
Step 6:<br />
4343
Navigate to <your_server>/admin and at least add upstream Jenkins to the source model:<br />
4444
<code>
@@ -52,7 +52,18 @@ And,<br />
5252
</code>
5353
<br />
5454
Step 7:<br />
55-
The service that actually queries Gerrit and saves the resultant data into the database is found in <code>aggregatorService.py</code>. This service must be started manually, or set to autorun on boot.<br /><br />
55+
The service that actually queries Gerrit and saves the resultant data into the database is found in <code>aggregatorService.py</code>. This service must be started manually, or set to autorun on boot. You can use the following upstart config, or write your own config for your init daemon of choice.<br />
56+
57+
description "CIMetrics Aggregator Service"
58+
author "Gabriel Loewen <gabloe@microsoft.com>"
59+
60+
start on runlevel [234]
61+
stop on runlevel [0156]
62+
63+
exec <SOURCE ROOT>/openstack_stats/aggregatorService.py
64+
#respawn
65+
66+
<br />
5667

5768
Deployment Instructions (Windows)
5869
=================================

statsproj/openstack_stats/aggregator/templates/aggregator/detail.html

Lines changed: 13 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
{% load staticfiles %}
1111
<script src="/static/jquery-1.9.1.js" type="text/javascript"></script>
1212
<script src="/static/jquery-ui.js" type="text/javascript"></script>
13-
<script src="/static/jquery-migrate-1.2.1.js" type="text/javascript"></script>
14-
<script src="/static/jquery.printElement.js" type="text/javascript"></script>
1513
<script src="/static/flot/jquery.flot.js" type="text/javascript"></script>
1614
<script src="/static/flot/jquery.flot.resize.js" type="text/javascript"></script>
1715
<script src="/static/flot/jquery.flot.time.js" type="text/javascript"></script>
@@ -31,7 +29,7 @@
3129
{% else %}
3230
var showTime = false;
3331
{% endif %}
34-
32+
3533
{% for key, value in upstreamResults.items %}
3634
var upstream{{ key|cut:"openstack/"|capfirst }}Success = {{ value.0|safe }};
3735
var upstream{{ key|cut:"openstack/"|capfirst }}Fail = {{ value.1|safe }};
@@ -43,16 +41,6 @@
4341
var {{ key|cut:"openstack/" }}Fail = {{ value.1|safe }};
4442
var {{ key|cut:"openstack/" }}Miss = {{ value.2|safe }};
4543
{% endfor %}
46-
47-
function printDiv()
48-
{
49-
var divToPrint=$("#main");
50-
newWin= window.open("");
51-
newWin.document.write(divToPrint.outerHTML);
52-
newWin.print();
53-
newWin.close();
54-
}
55-
5644
</script>
5745
<script type="text/javascript" src="/static/aggregator.js"></script>
5846
<link href="/static/themes/base/jquery-ui.css" rel="stylesheet" type="text/css">
@@ -62,41 +50,17 @@
6250
<body>
6351
<div id="content">
6452
<div id="sidebar">
65-
<h3 style="text-align: center;">{{ name }} Results</h3><br />
66-
<table style="width: 100%;">
67-
<tr>
68-
<td></td>
69-
<td><strong>Tests</strong></td>
70-
<td><strong>Patchsets</strong></td>
71-
</tr>
72-
<tr>
73-
<td><strong>Total</strong></td>
74-
<td id="total"></td>
75-
<td id="totalps"></td>
76-
</tr>
77-
<tr>
78-
<td><strong>Success</strong></td>
79-
<td id="success"></td>
80-
<td id="successps"></td>
81-
</tr>
82-
<tr>
83-
<td><strong>Failed</strong></td>
84-
<td id="failed"></td>
85-
<td id="failedps"></td>
86-
</tr>
87-
<tr>
88-
<td><strong>Missed</strong></td>
89-
<td id="missed"></td>
90-
<td id="missedps"></td>
91-
</tr>
92-
</table><br />
93-
<h3>Nova:</h3>
53+
<h2>{{ name }} Results</h2><br />
54+
<h2 id="total"></h2>
55+
<h2 id="success"></h2>
56+
<h2 id="failed"></h2>
57+
<h2 id="missed"></h2><br />
58+
<h2>Nova:</h3>
9459
<div id="novaInfo"></div>
95-
<h3>Neutron:</h3>
60+
<h2>Neutron:</h3>
9661
<div id="neutronInfo"></div>
9762
<div id="links">
9863
<ul>
99-
<li><a id="print" href="javascript:void(0)">Print</a></li>
10064
<li><a href="/">Go Back</a></li>
10165
<li><a href="/accounts/logout">Logout</a></li>
10266
</ul>
@@ -112,17 +76,17 @@ <h3>Neutron:</h3>
11276
<label for="timeGranular">High Granularity</label>&nbsp;
11377
</form>
11478
<table class="graphtable">
115-
<tr class="graphheader">
116-
<td colspan="2"><h3 class="inline">Nova Tests</h3><div class="legend" id="novachartlegend"></div></td>
79+
<tr>
80+
<td><h3 class="inline">Nova Tests</h3><div class="legend" id="novachartlegend"></div></td>
11781
</tr>
11882
<tr>
11983
<td class="linechart" id="novachart"></td>
12084
<td class="piechart" id="novapiechart"></td>
12185
</tr>
122-
</table>
86+
</table>
12387
<table class="graphtable">
124-
<tr class="graphheader">
125-
<td colspan="2"><h3 class="inline">Neutron Tests</h3><div class="legend" id="neutronchartlegend"></div></td>
88+
<tr>
89+
<td><h3 class="inline">Neutron Tests</h3><div class="legend" id="neutronchartlegend"></div></td>
12690
</tr>
12791
<tr>
12892
<td class="linechart" id="neutronchart"></td>

statsproj/openstack_stats/aggregator/views.py

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -44,62 +44,62 @@ def detail(request, name):
4444
context = {
4545
'mainResults': _mainResults,
4646
'upstreamResults': _upstreamResults,
47-
'start': mainDataSet[0],
48-
'end': mainDataSet[1],
47+
'start': mainDataSet[0],
48+
'end': mainDataSet[1],
4949
'granular': timeGranular,
5050
'name': name
5151
}
5252
else:
5353
context = {
5454
'mainResults': _mainResults,
5555
'upstreamResults': list(),
56-
'start': mainDataSet[0],
57-
'end': mainDataSet[1],
56+
'start': mainDataSet[0],
57+
'end': mainDataSet[1],
5858
'granular': timeGranular,
5959
'name': name
6060
}
6161

6262
#context = {
63-
# 'novaSuccess': list(mainResults[0]),
64-
# 'novaFail': list(mainResults[1]),
65-
# 'novaMiss': list(mainResults[2]),
66-
# 'neutronSuccess': list(mainResults[3]),
67-
# 'neutronFail': list(mainResults[4]),
68-
# 'neutronMiss': list(mainResults[5]),
69-
# 'totalSuccess': mainResults[6],
70-
# 'totalFail': mainResults[7],
71-
# 'totalMiss': mainResults[8],
72-
# 'upstreamNovaSuccess': list(upstreamResults[0]),
73-
# 'upstreamNovaFail': list(upstreamResults[1]),
74-
# 'upstreamNovaMiss': list(upstreamResults[2]),
75-
# 'upstreamNeutronSuccess': list(upstreamResults[3]),
76-
# 'upstreamNeutronFail': list(upstreamResults[4]),
77-
# 'upstreamNeutronMiss': list(upstreamResults[5]),
63+
# 'novaSuccess': list(mainResults[0]),
64+
# 'novaFail': list(mainResults[1]),
65+
# 'novaMiss': list(mainResults[2]),
66+
# 'neutronSuccess': list(mainResults[3]),
67+
# 'neutronFail': list(mainResults[4]),
68+
# 'neutronMiss': list(mainResults[5]),
69+
# 'totalSuccess': mainResults[6],
70+
# 'totalFail': mainResults[7],
71+
# 'totalMiss': mainResults[8],
72+
# 'upstreamNovaSuccess': list(upstreamResults[0]),
73+
# 'upstreamNovaFail': list(upstreamResults[1]),
74+
# 'upstreamNovaMiss': list(upstreamResults[2]),
75+
# 'upstreamNeutronSuccess': list(upstreamResults[3]),
76+
# 'upstreamNeutronFail': list(upstreamResults[4]),
77+
# 'upstreamNeutronMiss': list(upstreamResults[5]),
7878
# 'name': name,
79-
# 'start': mainDataSet[0],
80-
# 'end': mainDataSet[1],
79+
# 'start': mainDataSet[0],
80+
# 'end': mainDataSet[1],
8181
# 'granular': timeGranular,
8282
# }
8383
# else:
8484
# context = {
85-
# 'novaSuccess': list(mainResults[0]),
86-
# 'novaFail': list(mainResults[1]),
87-
# 'novaMiss': list(mainResults[2]),
88-
# 'neutronSuccess': list(mainResults[3]),
89-
# 'neutronFail': list(mainResults[4]),
90-
# 'neutronMiss': list(mainResults[5]),
91-
# 'totalSuccess': mainResults[6],
92-
# 'totalFail': mainResults[7],
93-
# 'totalMiss': mainResults[8],
94-
# 'upstreamNovaSuccess': list(),
95-
# 'upstreamNovaFail': list(),
96-
# 'upstreamNovaMiss': list(),
97-
# 'upstreamNeutronSuccess': list(),
98-
# 'upstreamNeutronFail': list(),
99-
# 'upstreamNeutronMiss': list(),
85+
# 'novaSuccess': list(mainResults[0]),
86+
# 'novaFail': list(mainResults[1]),
87+
# 'novaMiss': list(mainResults[2]),
88+
# 'neutronSuccess': list(mainResults[3]),
89+
# 'neutronFail': list(mainResults[4]),
90+
# 'neutronMiss': list(mainResults[5]),
91+
# 'totalSuccess': mainResults[6],
92+
# 'totalFail': mainResults[7],
93+
# 'totalMiss': mainResults[8],
94+
# 'upstreamNovaSuccess': list(),
95+
# 'upstreamNovaFail': list(),
96+
# 'upstreamNovaMiss': list(),
97+
# 'upstreamNeutronSuccess': list(),
98+
# 'upstreamNeutronFail': list(),
99+
# 'upstreamNeutronMiss': list(),
100100
# 'name': name,
101-
# 'start': mainDataSet[0],
102-
# 'end': mainDataSet[1],
101+
# 'start': mainDataSet[0],
102+
# 'end': mainDataSet[1],
103103
# 'granular': timeGranular,
104104
# }
105105

@@ -150,29 +150,29 @@ def _getWorkerDetails(data, timeGranular, name, getTotals):
150150
elif d.missed:
151151
insertOrIncrement(_miss, timeOffset)
152152
else:
153-
insertOrIncrement(_fail, timeOffset)
153+
insertOrIncrement(_fail, timeOffset)
154154

155155
success = []
156156
fail = []
157157
miss = []
158158
for key in _success:
159-
success += [[key,_success[key]]]
159+
success += [[key,_success[key]]]
160160
for key in _fail:
161-
fail += [[key,_fail[key]]]
161+
fail += [[key,_fail[key]]]
162162
for key in _miss:
163-
miss += [[key,_miss[key]]]
163+
miss += [[key,_miss[key]]]
164164

165165
success = sorted(success, key=lambda l:l[0])
166166
fail = sorted(fail, key=lambda l:l[0])
167167
miss = sorted(miss, key=lambda l:l[0])
168168
ret[project] = [success,fail,miss]
169169

170170
if getTotals:
171-
totalSuccess = data.filter(success=True)
172-
totalFail = data.filter(success=False,missed=False)
173-
totalMiss = data.filter(missed=True)
174-
ret["total"] = [len(list(totalSuccess)), len(list(totalFail)), len(list(totalMiss))]
175-
ret["patchset"] = [len(list(totalSuccess.values('cid','pid').distinct())), len(list(totalFail.values('cid','pid').distinct())), len(list(totalMiss.values('cid','pid').distinct()))]
171+
totalSuccess = len(list(data.filter(success=True)))
172+
totalFail = len(list(data.filter(success=False,missed=False)))
173+
totalMiss = len(list(data.filter(missed=True)))
174+
ret["total"] = [totalSuccess, totalFail, totalMiss]
175+
176176
return ret
177177

178178
# Get details for the worker, both Nova and Neutron data
@@ -197,7 +197,7 @@ def getWorkerDetails(data, timeGranular, getTotals):
197197
elif d.missed:
198198
insertOrIncrement(_novaMiss, timeOffset)
199199
else:
200-
insertOrIncrement(_novaFail, timeOffset)
200+
insertOrIncrement(_novaFail, timeOffset)
201201

202202
novaSuccess = []
203203
novaFail = []
@@ -233,7 +233,7 @@ def getWorkerDetails(data, timeGranular, getTotals):
233233
elif d.missed:
234234
insertOrIncrement(_neutronMiss, timeOffset)
235235
else:
236-
insertOrIncrement(_neutronFail, timeOffset)
236+
insertOrIncrement(_neutronFail, timeOffset)
237237

238238
neutronSuccess = []
239239
neutronFail = []
@@ -244,8 +244,8 @@ def getWorkerDetails(data, timeGranular, getTotals):
244244
neutronFail += [[key,_neutronFail[key]]]
245245
for key in _neutronMiss:
246246
neutronMiss += [[key,_neutronMiss[key]]]
247-
248-
# Sort the neutron data based on date/timestamp
247+
248+
# Sort the neutron data based on date/timestamp
249249
neutronSuccess = sorted(neutronSuccess, key=lambda l:l[0])
250250
neutronFail = sorted(neutronFail, key=lambda l:l[0])
251251
neutronMiss = sorted(neutronMiss, key=lambda l:l[0])

0 commit comments

Comments
 (0)