Permalink
Browse files

lots of changes

  • Loading branch information...
1 parent e5f9fbd commit 21119544ae92172f66f45039d657724abbf9d1a2 @jeads jeads committed Dec 5, 2012
@@ -56,7 +56,10 @@ def handle_project(self, project, **options):
metrics_exclude_projects = set(['b2g', 'stoneridge'])
if project not in metrics_exclude_projects:
+ #minimum required number of replicates for
+ #metrics processing
+ replicate_min = 5
compute_test_run_metrics(
- project, pushlog_project, debug, test_run_ids
+ project, pushlog_project, debug, replicate_min, test_run_ids
)
@@ -14,7 +14,7 @@
])
def compute_test_run_metrics(
- project, pushlog_project, debug, test_run_ids=[]
+ project, pushlog_project, debug, replicate_min, test_run_ids=[]
):
"""
Runs all metric tests and associated summaries on a list of test run ids
@@ -69,7 +69,7 @@ def compute_test_run_metrics(
base_message = u"{0} {1}".format(child_revision, str(test_run_id))
if not check_run_conditions(
- test_name, rep_count, push_node, branch, debug
+ test_name, rep_count, push_node, branch, replicate_min, debug
):
println(u"Not able to run {0}\n".format(base_message), debug)
continue
@@ -129,7 +129,9 @@ def run_test(test_name):
return execute_metrics
-def check_run_conditions(test_name, rep_count, push_node, branch, debug):
+def check_run_conditions(
+ test_name, rep_count, push_node, branch, replicate_min, debug
+ ):
"""
Test a set of conditions that have to be met in order to run the set of
metrics tests.
@@ -139,7 +141,7 @@ def check_run_conditions(test_name, rep_count, push_node, branch, debug):
println(u"Cannot run {0}".format(test_name), debug)
return False
- if rep_count < 5:
+ if rep_count < replicate_min:
#If we don't have more than one replicate we cannot
#run any of the existing metric tests
println(
@@ -102,13 +102,15 @@ def get_metrics_summary(
#test page metric
metrics_data = mtm.get_metrics_summary(test_run_ids)
- #get push info
- push_data = plm.get_node_from_revision(revision, branch)
- metrics_data['push_data'] = push_data
+ if metrics_data:
- #get the products associated with this revision/branch combination
- products = ptm.get_revision_products(revision, branch)
- metrics_data['products'] = products
+ #get push info
+ push_data = plm.get_node_from_revision(revision, branch)
+ metrics_data['push_data'] = push_data
+
+ #get the products associated with this revision/branch combination
+ products = ptm.get_revision_products(revision, branch)
+ metrics_data['products'] = products
plm.disconnect()
ptm.disconnect()
@@ -119,8 +121,8 @@ def get_metrics_summary(
def get_metrics_pushlog(
project, branch, revision, product_name=None, os_name=None,
os_version=None, branch_version=None, processor=None, build_type=None,
- test_name=None, page_name=None, days_ago=None, pushes_before=None,
- pushes_after=None, numdays=None, pushlog_project=None
+ test_name=None, page_name=None, pushes_before=None, pushes_after=None,
+ pushlog_project=None
):
"""Return a metrics summary based on the parameters and optional filters."""
@@ -699,7 +699,7 @@ def get_revision_products(self, revision, branch):
proc=proc,
debug_show=self.DEBUG,
return_type='tuple',
- placeholders=[revision, branch]
+ placeholders=[revision]
)
return products
@@ -761,6 +761,8 @@ def get_metrics_summary(self, test_run_ids):
def get_test_run_ids_from_pushlog_ids(self, pushlog_ids=[]):
+ pushlog_ids.append(1)
+
rep = []
placeholders = []
placeholders.extend(pushlog_ids)
@@ -770,7 +772,6 @@ def get_test_run_ids_from_pushlog_ids(self, pushlog_ids=[]):
test_run_ids = []
if pushlog_ids:
-
replace = ','.join( map( lambda pushlog_id: '%s', pushlog_ids ) )
rep.append(replace)
replace = [" ".join(rep)] if len(rep) else [" "]
@@ -452,7 +452,7 @@
FROM test_run AS tr
LEFT JOIN build AS b ON tr.build_id = b.id
LEFT JOIN product AS p ON b.product_id = p.id
- WHERE tr.revision = ? AND p.branch = ?
+ WHERE tr.revision = ?
GROUP BY p.product, p.branch, p.version",
"host":"read_host"
@@ -143,13 +143,6 @@ def get_metrics_pushlog(request, project, branch, revision):
test_name = request.GET.get("test_name", None)
page_name = request.GET.get("page_name", None)
-
- days_ago = 0
- try:
- days_ago = int(request.GET.get("days_ago", 0))
- except ValueError:
- pass
-
#applies to both before/after, so total of 2*maximum_pushes
#are allowed
maximum_pushes = 1000
@@ -172,12 +165,6 @@ def get_metrics_pushlog(request, project, branch, revision):
if pushes_after > maximum_pushes:
pushes_after = maximum_pushes
- numdays = 0
- try:
- numdays = int(request.GET.get("numdays", 0))
- except ValueError:
- pass
-
pushlog_project = request.GET.get("pushlog_project", None)
if not test_name:
@@ -199,10 +186,8 @@ def get_metrics_pushlog(request, project, branch, revision):
build_type=build_type,
test_name=test_name,
page_name=page_name,
- days_ago=days_ago,
pushes_before=pushes_before,
pushes_after=pushes_after,
- numdays=numdays,
pushlog_project=pushlog_project
)),
content_type=API_CONTENT_TYPE,
@@ -11,5 +11,10 @@
def summary_page(request, project="", branch="", revision=""):
- return render_to_response('metrics.summary.html', {})
+ #give template access to the DEBUG variable
+ template_context = { 'DEBUG':settings.DEBUG }
+
+ return render_to_response(
+ 'metrics.summary.html', template_context
+ )
Oops, something went wrong.
@@ -6,35 +6,70 @@ body {
border-top: 2px solid #676767;
min-width: 1065px;
}
+div.su-title {
+ background: url("/static/images/title.png") no-repeat scroll 0 center transparent;
+ position: absolute;
+ left: 15px;
+ width:400px;
+ height:100%;
+ top: 0;
+ z-index: 1;
+}
a {
text-decoration: underline;
font-weight: bold;
}
div.su-large-text {
font-size: 14px;
}
+.su-light-text {
+ opacity: 0.8;
+}
+.su-light-text2 {
+ opacity: 0.5;
+}
+div.su-toolpanel {
+ width: 95%;
+ height:50px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 10px;
+ font-size:0.750em;
+}
+div.su-toolbar-base {
+ /*************
+ * Sets basic layout and background properties
+ * for toolbar components
+ *************/
+ position: relative;
+ margin-left: auto;
+ margin-right: auto;
+ background: transparent #2a2a2a;
+ background: transparent rgba(38,38,38,0.98);
+}
+div.su-vis-detail-panel {
+ margin-top: 5px;
+ padding: 0.5em;
+ overflow: auto;
+}
div.su-toppanel {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: 0 solid #000;
background: -moz-linear-gradient(-90deg, #74D435, #43AA00);
background: -webkit-gradient(linear, left top, left bottom, from(#74D435), to(#43AA00));
-
height: 50px;
width: 95%;
margin-top: 20px;
padding-top: 10px;
}
div.su-panel-base {
-
width: 93%;
- height: 300px;
+ height: 320px;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
-
background: white;
-
}
div.su-main-gauge {
float: left;
@@ -94,12 +129,6 @@ div.su-progressbar-value {
margin-left: 5;
}
-.su-light-text {
- opacity: 0.8;
-}
-.su-light-text2 {
- opacity: 0.5;
-}
.su-pass-color {
color: #44AA00;
}
@@ -124,14 +153,11 @@ div.su-column-headers {
margin-top:60px;
}
div.su-row-headers {
-
float: left;
width: 125px;
text-align: right;
-
margin-right: 10px;
margin-top: 10px;
-
}
div.su-grid-values {
float: left;
@@ -142,7 +168,6 @@ div.su-grid-values {
border-left: thin solid;
}
div.su-grid-column {
-
-webkit-transform:rotate(320deg);
-moz-transform:rotate(320deg);
-o-transform: rotate(320deg);
@@ -156,13 +181,11 @@ div.su-grid-row {
float: left;
height:30px;
width: 125px;
-
}
div.su-grid-value {
float: left;
width: 30px;
height: 30px;
-
border-bottom: thin solid;
border-right: thin solid;
}
@@ -292,3 +315,19 @@ div.su-datum-desc-value {
left:135px;
margin-top:150px;
}
+div.su-wordwrap {
+ white-space: pre-wrap; /* CSS3 */
+ white-space: -moz-pre-wrap; /* Firefox */
+ white-space: -pre-wrap; /* Opera <7 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* IE */
+}
+hr.su-light-horz-line {
+ background-color:#0D2054;
+}
+.css-right {
+ float: right;
+}
+.css-left {
+ float: left;
+}
@@ -4,11 +4,12 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
* *****/
String.prototype.hashCode = function(){
- var hash = 0, i, char;
+ //Builds a 32bit integer hash of a string
+ var hash = 0, i, charCode;
if (this.length == 0) return hash;
for (i = 0; i < this.length; i++) {
- char = this.charCodeAt(i);
- hash = ((hash<<5)-hash)+char;
+ charCode = this.charCodeAt(i);
+ hash = ((hash<<5)-hash)+charCode;
hash = hash & hash; // Convert to 32bit integer
}
return Math.abs(hash);
Oops, something went wrong.

0 comments on commit 2111954

Please sign in to comment.