Skip to content
Browse files

made changes

  • Loading branch information...
1 parent 6a72591 commit e5f9fbd32c79cbf5b3a533603375be8e6f9a3297 @jeads jeads committed Dec 3, 2012
View
2 datazilla/controller/admin/metrics/perftest_metrics.py
@@ -139,7 +139,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 < 3:
+ if rep_count < 5:
#If we don't have more than one replicate we cannot
#run any of the existing metric tests
println(
View
8 datazilla/controller/admin/refdata/pushlog_refdata.py
@@ -62,6 +62,14 @@ def get_all_branches():
plm.disconnect()
return branches
+def get_branch_uri(branch):
+ """Return the requested branch uri. If no branch is requested return all
+ branch uris."""
+ plm = factory.get_plm()
+ branches = plm.get_branch_uri(branch)
+ plm.disconnect()
+ return branches
+
def get_db_size():
"""Return the database size, on disk in MB"""
View
74 datazilla/controller/admin/testdata.py
@@ -8,18 +8,18 @@
from datazilla.model import utils
def get_testdata(
- project, branch, revision, os_name=None, os_version=None,
- branch_version=None, processor=None, build_type=None, test_name=None,
- page_name=None):
+ 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):
"""Return test data based on the parameters and optional filters."""
ptm = factory.get_ptm(project)
ptrdm = factory.get_ptrdm(project)
# get the testrun ids from perftest
test_run_ids = ptm.get_test_run_ids(
- branch, [revision], os_name, os_version, branch_version, processor,
- build_type, test_name
+ branch, [revision], product_name, os_name, os_version,
+ branch_version, processor, build_type, test_name
)
blobs = ptrdm.get_object_json_blob_for_test_run(test_run_ids)
@@ -57,9 +57,9 @@ def get_testdata(
def get_metrics_data(
- project, branch, revision, os_name=None, os_version=None,
- branch_version=None, processor=None, build_type=None, test_name=None,
- page_name=None
+ 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
):
"""Return metrics data based on the parameters and optional filters."""
@@ -68,8 +68,8 @@ def get_metrics_data(
# get the testrun ids from perftest
test_run_ids = ptm.get_test_run_ids(
- branch, [revision], os_name, os_version, branch_version, processor,
- build_type, test_name
+ branch, [revision], product_name, os_name, os_version,
+ branch_version, processor, build_type, test_name
)
#test page metric
@@ -83,33 +83,44 @@ def get_metrics_data(
return metrics_data
def get_metrics_summary(
- project, branch, revision, os_name=None, os_version=None,
- branch_version=None, processor=None, build_type=None, test_name=None
+ project, branch, revision, product_name=None, os_name=None,
+ os_version=None, branch_version=None, processor=None, build_type=None,
+ test_name=None, pushlog_project=None
):
"""Return a metrics summary based on the parameters and optional filters."""
+ plm = factory.get_plm(pushlog_project)
ptm = factory.get_ptm(project)
mtm = factory.get_mtm(project)
# get the testrun ids from perftest
test_run_ids = ptm.get_test_run_ids(
- branch, [revision], os_name, os_version, branch_version, processor,
- build_type, test_name
+ branch, [revision], product_name, os_name, os_version,
+ branch_version, processor, build_type, test_name
)
#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
+
+ #get the products associated with this revision/branch combination
+ products = ptm.get_revision_products(revision, branch)
+ metrics_data['products'] = products
+
+ plm.disconnect()
ptm.disconnect()
mtm.disconnect()
return metrics_data
def get_metrics_pushlog(
- project, branch, revision, 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
+ 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
):
"""Return a metrics summary based on the parameters and optional filters."""
@@ -134,6 +145,11 @@ def get_metrics_pushlog(
changesets = changeset_lookup[ node['pushlog_id'] ]
+ #The revisions associated with a push are returned in reverse order
+ #from the pushlog web service. This orders them the same way tbpl
+ #does.
+ changesets['revisions'].reverse()
+
#truncate the revision strings and collect them
for cset_index, revision_data in enumerate(changesets['revisions']):
@@ -151,8 +167,8 @@ def get_metrics_pushlog(
# get the testrun ids from perftest
filtered_test_run_ids = ptm.get_test_run_ids(
- branch, all_revisions, os_name, os_version, branch_version,
- processor, build_type, test_name
+ branch, all_revisions, product_name, os_name, os_version,
+ branch_version, processor, build_type, test_name
)
# get the test run ids associated with the pushlog ids
@@ -194,3 +210,21 @@ def get_application_log(project, revision):
log = mtm.get_application_log(revision)
return log
+def get_default_version(project, branch, product_name):
+
+ ptm = factory.get_ptm(project)
+
+ default_version = ptm.get_default_branch_version(
+ branch, product_name
+ )
+
+ ptm.disconnect()
+
+ version = ""
+ if 'version' in default_version:
+ version = default_version['version']
+
+ return version
+
+
+
View
74 datazilla/model/base.py
@@ -85,8 +85,6 @@ def create(cls, host=None, type=None, project=None):
use "MySQL-Engine", where "Engine" could be "InnoDB", "Aria", etc. Not
all contenttypes need to be represented; any that aren't will use the
default (``MySQL-InnoDB``).
-
-
"""
project = project or cls.DEFAULT_PROJECT
@@ -137,6 +135,28 @@ def get_branch_list(self, branch=None):
return branch_list
+ def get_branch_uri(self, branch=None):
+
+ if branch:
+
+ proc = 'hgmozilla.selects.get_branch_uri'
+
+ data = self.hg_ds.dhub.execute(
+ proc=proc,
+ debug_show=self.DEBUG,
+ placeholders=[branch],
+ return_type='tuple',
+ )
+ else:
+ proc = 'hgmozilla.selects.get_all_branch_uris'
+
+ data = self.hg_ds.dhub.execute(
+ proc=proc,
+ debug_show=self.DEBUG,
+ return_type='tuple',
+ )
+
+ return data
def get_all_pushlogs(self):
@@ -251,18 +271,22 @@ def get_branch_pushlog_by_revision(
pushes_before_proc = 'hgmozilla.selects.get_push_ids_before_node'
pushes_after_proc = 'hgmozilla.selects.get_push_ids_after_node'
+ before_boundary = push_id - pushes_before
+
pushes_before_data = self.hg_ds.dhub.execute(
proc=pushes_before_proc,
debug_show=self.DEBUG,
return_type='tuple',
- placeholders=[push_id, branch_id, pushes_before]
+ placeholders=[ push_id, before_boundary, branch_id ]
)
+ after_boundary = push_id + pushes_after
+
pushes_after_data = self.hg_ds.dhub.execute(
proc=pushes_after_proc,
debug_show=self.DEBUG,
return_type='tuple',
- placeholders=[push_id, branch_id, pushes_after]
+ placeholders=[ push_id, after_boundary, branch_id ]
)
#Combine all of the requested push data
@@ -667,6 +691,19 @@ def get_products(self, key_column=None):
return products
+ def get_revision_products(self, revision, branch):
+
+ proc = 'perftest.selects.get_revision_products'
+
+ products = self.sources["perftest"].dhub.execute(
+ proc=proc,
+ debug_show=self.DEBUG,
+ return_type='tuple',
+ placeholders=[revision, branch]
+ )
+
+ return products
+
def get_default_products(self):
@@ -684,6 +721,24 @@ def get_default_products(self):
return default_products
+ def get_default_branch_version(self, branch, product_name):
+
+ proc = 'perftest.selects.get_default_products'
+
+ products = self.sources["perftest"].dhub.execute(
+ proc=proc,
+ debug_show=self.DEBUG,
+ return_type='tuple'
+ )
+
+ target_product = {}
+
+ for product in products:
+ if (product['branch'] == branch) and (product['product'] == product_name):
+ target_product = product
+ break
+
+ return target_product
def get_machines(self):
@@ -901,9 +956,9 @@ def get_test_run_value_summary(self, test_run_id):
def get_test_run_ids(
- self, branch, revisions, os_name=None, os_version=None,
- branch_version=None, processor=None, build_type=None,
- test_name=None, page_name=None):
+ self, branch, revisions, product_name=None, os_name=None,
+ os_version=None, branch_version=None, processor=None,
+ build_type=None, test_name=None, page_name=None):
proc = 'perftest.selects.get_test_run_ids'
placeholders = [branch]
@@ -914,7 +969,10 @@ def get_test_run_ids(
self.get_replace_and_placeholders(
rep, placeholders, 'tr.revision', revision_string
)
-
+ if product_name:
+ self.get_replace_and_placeholders(
+ rep, placeholders, 'p.product', product_name
+ )
if os_name:
self.get_replace_and_placeholders(
rep, placeholders, 'os.name', os_name
View
29 datazilla/model/sql/hgmozilla.json
@@ -77,15 +77,32 @@
"host":"read_host"
},
+ "get_branch_uri":{
+
+ "sql":"SELECT b.name, b.uri
+ FROM branches AS b
+ WHERE b.name = ?",
+
+ "host":"read_host"
+ },
+
+ "get_all_branch_uris":{
+
+ "sql":"SELECT b.name, b.uri
+ FROM branches AS b",
+
+ "host":"read_host"
+ },
+
"get_push_ids_before_node":{
"sql":"SELECT p.id AS 'pushlog_id',
p.push_id,
p.date,
p.user
FROM pushlogs AS p
- WHERE p.push_id < ? AND p.branch_id = ?
- LIMIT ?",
+ WHERE p.push_id < ? AND p.push_id >= ? AND p.branch_id = ?
+ ORDER BY p.push_id",
"host":"read_host"
},
@@ -97,8 +114,8 @@
p.date,
p.user
FROM pushlogs AS p
- WHERE p.push_id > ? AND p.branch_id = ?
- LIMIT ?",
+ WHERE p.push_id > ? AND p.push_id <= ? AND p.branch_id = ?
+ ORDER BY p.push_id",
"host":"read_host"
},
@@ -134,9 +151,11 @@
"sql":"SELECT p.id AS 'pushlog_id',
p.push_id,
p.date,
+ p.user,
b.id AS 'branch_id',
b.name,
- c.node
+ c.node,
+ c.desc
FROM pushlogs AS p
LEFT JOIN changesets AS c ON p.id = c.pushlog_id
LEFT JOIN branches AS b ON p.branch_id = b.id
View
20 datazilla/model/sql/perftest.json
@@ -410,8 +410,8 @@
"get_test_run_counts":{
"sql":"SELECT COUNT(tr.id) as count, p.branch
- FROM test_run as tr
- LEFT JOIN build as b ON tr.build_id = b.id
+ 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.date_run BETWEEN ? AND ?
GROUP BY p.branch",
@@ -422,12 +422,11 @@
"get_test_run_ids":{
"sql":"SELECT DISTINCT(tr.id) AS test_run_id
FROM test_run AS tr
- LEFT JOIN test_value AS tv ON tr.id = tv.test_run_id
LEFT JOIN build AS b ON b.id = tr.build_id
LEFT JOIN product AS p ON p.id = b.product_id
LEFT JOIN machine AS m ON m.id = tr.machine_id
- LEFT JOIN operating_system as os on os.id = m.operating_system_id
- LEFT JOIN test as t on t.id = tr.test_id
+ LEFT JOIN operating_system AS os ON os.id = m.operating_system_id
+ LEFT JOIN test AS t ON t.id = tr.test_id
WHERE p.branch = ? REP0",
"host":"read_host"
@@ -447,6 +446,17 @@
"host":"read_host"
},
+ "get_revision_products":{
+
+ "sql":"SELECT p.product, p.branch, p.version
+ 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 = ?
+ GROUP BY p.product, p.branch, p.version",
+
+ "host":"read_host"
+ },
"get_test_run_values":{
"sql":"SELECT tv.test_run_id,
View
6 datazilla/webapp/apps/datazilla/refdata/pushlog_views.py
@@ -64,6 +64,12 @@ def get_all_branches(request):
branches = pushlog_refdata.get_all_branches()
return HttpResponse(json.dumps(branches), content_type=API_CONTENT_TYPE)
+def get_branch_uri(request):
+ """Get the uri associated with branch"""
+ branch = request.GET.get("branch", None)
+ branches = pushlog_refdata.get_branch_uri(branch)
+ return HttpResponse(json.dumps(branches), content_type=API_CONTENT_TYPE)
+
def get_db_size(request):
"""Return the size of the DB on disk in MB."""
View
2 datazilla/webapp/apps/datazilla/refdata/urls_no_project.py
@@ -8,6 +8,8 @@
(r"^pushlog/branches/?$", "pushlog_views.get_all_branches"),
+ (r"^pushlog/branch_uri/?$", "pushlog_views.get_branch_uri"),
+
(r"^pushlog/db_size/?$", "pushlog_views.get_db_size"),
)
View
33 datazilla/webapp/apps/datazilla/testdata/views.py
@@ -16,7 +16,6 @@
API_CONTENT_TYPE = 'application/json; charset=utf-8'
-
def get_testdata(request, project, branch, revision):
"""
Apply data filters and return all test data objects associated with the
@@ -51,9 +50,18 @@ def get_metrics_data(request, project, branch, revision):
"""
Apply filters and return all metrics data associated with the revision.
"""
+
+ #Default to most current version of Firefox
+ product_name = request.GET.get("product", "Firefox")
os_name = request.GET.get("os_name", None)
os_version = request.GET.get("os_version", None)
+
branch_version = request.GET.get("branch_version", None)
+ if not branch_version:
+ branch_version = testdata.get_default_version(
+ project, branch, product_name
+ )
+
processor = request.GET.get("processor", None)
build_type = request.GET.get("build_type", None)
test_name = request.GET.get("test_name", None)
@@ -64,6 +72,7 @@ def get_metrics_data(request, project, branch, revision):
project,
branch,
revision,
+ product_name=product_name,
os_name=os_name,
os_version=os_version,
branch_version=branch_version,
@@ -80,24 +89,35 @@ def get_metrics_summary(request, project, branch, revision):
Apply filters and build a summary of all metric test evaluations.
"""
+ #Default to most current version of Firefox
+ product_name = request.GET.get("product", "Firefox")
os_name = request.GET.get("os_name", None)
os_version = request.GET.get("os_version", None)
+
branch_version = request.GET.get("branch_version", None)
+ if not branch_version:
+ branch_version = testdata.get_default_version(
+ project, branch, product_name
+ )
+
processor = request.GET.get("processor", None)
build_type = request.GET.get("build_type", None)
test_name = request.GET.get("test_name", None)
+ pushlog_project = request.GET.get("pushlog_project", None)
return HttpResponse(
json.dumps(testdata.get_metrics_summary(
project,
branch,
revision,
+ product_name=product_name,
os_name=os_name,
os_version=os_version,
branch_version=branch_version,
processor=processor,
build_type=build_type,
test_name=test_name,
+ pushlog_project=pushlog_project
)),
content_type=API_CONTENT_TYPE,
)
@@ -106,9 +126,18 @@ def get_metrics_pushlog(request, project, branch, revision):
"""
Apply filters and return trend line data for the time period requested.
"""
+
+ #Default to most current version of Firefox
+ product_name = request.GET.get("product", "Firefox")
os_name = request.GET.get("os_name", None)
os_version = request.GET.get("os_version", None)
+
branch_version = request.GET.get("branch_version", None)
+ if not branch_version:
+ branch_version = testdata.get_default_version(
+ project, branch, product_name
+ )
+
processor = request.GET.get("processor", None)
build_type = request.GET.get("build_type", None)
test_name = request.GET.get("test_name", None)
@@ -162,6 +191,7 @@ def get_metrics_pushlog(request, project, branch, revision):
project,
branch,
revision,
+ product_name=product_name,
os_name=os_name,
os_version=os_version,
branch_version=branch_version,
@@ -191,3 +221,4 @@ def get_application_log(request, project, revision):
)
+
View
54 datazilla/webapp/static/css/summary.css
@@ -4,8 +4,11 @@ body {
font-size: 14px;
padding: 0;
border-top: 2px solid #676767;
- /*min-width: 1024px;*/
- min-width: 1050px;
+ min-width: 1065px;
+}
+a {
+ text-decoration: underline;
+ font-weight: bold;
}
div.su-large-text {
font-size: 14px;
@@ -35,7 +38,7 @@ div.su-panel-base {
}
div.su-main-gauge {
float: left;
- width: 325px;
+ width: 375px;
margin-left:10px;
}
div.su-reference-info {
@@ -146,7 +149,6 @@ div.su-grid-column {
white-space:nowrap;
text-align:center;
float: left;
-
width:30px;
height:25px;
}
@@ -205,8 +207,7 @@ div.su-grid-value {
background: #ffffff;
border: 3px solid #e8e8e8;
}
-.arrow_box:after,
-.arrow_box:before {
+.arrow_box:after, .arrow_box:before {
top: 100%;
border: solid transparent;
content: " ";
@@ -228,6 +229,35 @@ div.su-grid-value {
left: 50%;
margin-left: -24px;
}
+
+.arrow_box_up {
+ position: relative;
+ background: #ffffff;
+ border: 3px solid #e8e8e8;
+}
+.arrow_box_up:after, .arrow_box_up:before {
+ bottom: 100%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.arrow_box_up:after {
+ border-color: rgba(255, 255, 255, 0);
+ border-bottom-color: #ffffff;
+ border-width: 20px;
+ left: 50%;
+ margin-left: -20px;
+}
+.arrow_box_up:before {
+ border-color: rgba(232, 232, 232, 0);
+ border-bottom-color: #e8e8e8;
+ border-width: 24px;
+ left: 50%;
+ margin-left: -24px;
+}
div.su-data-series-panel {
margin-top: 5px;
padding: 0.5em;
@@ -238,7 +268,17 @@ div.su-datum-info-panel {
margin-left: 5px;
padding: 0.5em;
float:right;
- width:180px;
+ width:190px;
+}
+.su-datum-value {
+ text-align:right;
+ float:right;
+}
+/*style for the description field of a patch*/
+div.su-datum-desc-value {
+ text-align:right;
+ margin-top:5px;
+ margin-bottom:15px;
}
.ui-button-text{
font-size: 11px !important;
View
57 datazilla/webapp/static/js/metric_summary/MetricDashboardComponent.js
@@ -79,8 +79,10 @@ var MetricDashboardView = new Class({
this.progressBarTitleClassName = 'su-progressbar-title';
this.progressBarClassName = 'su-progressbar';
- this.productTestsSel = '#su_product_tested';
+ this.revisionProductsSel = '#su_revision_products';
this.revisionTestedSel = '#su_revision_tested';
+ this.pushDescSel = '#su_push_desc';
+ this.authorSel = '#su_push_author';
this.totalCountSel = '#su_total_count';
this.noTrendCountSel = '#su_no_trend_count';
this.passCountSel = '#su_pass_count';
@@ -191,13 +193,49 @@ var MetricDashboardView = new Class({
},
setReferenceInfo: function(data){
- var productInfo = data.product_info.name + ' ' +
- data.product_info.branch + ' ' + data.product_info.version;
+ for(var i=0; i<data.products.length; i++){
- $(this.productTestsSel).text(productInfo);
+ var product = data.products[i].product + ' ' +
+ data.products[i].branch + ' ' + data.products[i].version;
- $(this.revisionTestedSel).text(
- data.product_info.revision
+ var option = $(document.createElement('option'));
+
+ $(option).text(product);
+
+ $(option).val(
+ JSON.stringify(
+ { 'product':data.products[i].product,
+ 'version':data.products[i].version }
+ )
+ );
+
+ if((data.product_info.name === data.products[i].product) &&
+ (data.product_info.branch === data.products[i].branch) &&
+ (data.product_info.version === data.products[i].version)){
+ //This is the option the page is loaded on
+ //mark as selected
+ $(option).attr('selected', true);
+ }
+ $(this.revisionProductsSel).append(option);
+
+ }
+
+ $(this.revisionProductsSel).change(
+ _.bind( function(event){
+ var selectedOption = $(event.target).find(':selected');
+
+ var value = $(selectedOption).val();
+ var productData = JSON.parse(value);
+
+ console.log(productData);
+
+ }, this)
+ );
+
+ $(this.authorSel).text(data.push_data.user);
+
+ $(this.revisionTestedSel).html(
+ MS_PAGE.getHgUrlATag('rev', data.product_info.revision)
);
$(this.noTrendCountSel).text(data.summary.keys_without_trend);
@@ -206,6 +244,9 @@ var MetricDashboardView = new Class({
$(this.passCountSel).text(data.summary.pass.value + ' passed');
$(this.failCountSel).text(data.summary.fail.value + ' failed');
+ var descHtml = MS_PAGE.addBugzillaATagsToDesc(data.push_data.desc);
+ $(this.pushDescSel).html(descHtml);
+
},
loadProgressBars: function(targetContainer, data, order){
@@ -280,7 +321,9 @@ var MetricDashboardModel = new Class({
uri = '/' + MS_PAGE.refData.project +
'/testdata/metrics/' + MS_PAGE.refData.branch +
- '/' + MS_PAGE.refData.revision + '/summary';
+ '/' + MS_PAGE.refData.revision + '/summary?' +
+ 'product=' + MS_PAGE.refData.product + '&branch_version=' +
+ MS_PAGE.refData.branch_version;
jQuery.ajax( uri, {
accepts:'application/json',
View
32 datazilla/webapp/static/js/metric_summary/MetricGridComponent.js
@@ -166,9 +166,35 @@ var MetricGridView = new Class({
//first time the page loads.
if(this.triggerDefaultEvent){
- this._triggerEvent(
- this.gridMouseoverEvent, cell
- );
+ var platform = MS_PAGE.refData.platform;
+ var test = MS_PAGE.refData.test;
+ var initializeValue = "";
+ if(data.tests[test] && data.tests[test][platform]){
+ initializeValue = data.tests[test][platform]['pass']['percent'];
+ }
+
+ if(initializeValue){
+ //URL has test/platform specified, initialize
+ //table to requested data target
+ var initializeCell = this.getValueCell(
+ platform,
+ test,
+ initializeValue
+ );
+
+ this._triggerEvent(
+ this.gridMouseoverEvent, initializeCell
+ );
+
+ //Lock the table to the data requested
+ MS_PAGE.testPagesComponent.view.lockTable();
+
+ }else {
+ //No target table use first defined cell
+ this._triggerEvent(
+ this.gridMouseoverEvent, cell
+ );
+ }
this.triggerDefaultEvent = false;
}
View
63 datazilla/webapp/static/js/metric_summary/MetricSummaryPage.js
@@ -18,15 +18,56 @@ var MetricSummaryPage = new Class( {
this.failColor = '#FF7700';
this.passColor = '#44AA00';
+ this.branchUri = '/refdata/pushlog/branch_uri?branch=';
+ this.revisionUrl = 'https://hg.mozilla.org/URI/pushloghtml?TYPE=';
+ this.bugzillaUrl = 'https://bugzilla.mozilla.org/show_bug.cgi?id=';
+
},
+ getHgUrlATag: function(type, revision){
+ /****
+ * Get an html <a> tag for the given type and revision provided.
+ * Type can be 'rev' or 'changeset'.
+ ****/
+ var revisionUrl = this.revisionUrl.replace(
+ 'URI', MS_PAGE.refData.branch_uri
+ );
+
+ revisionUrl = revisionUrl.replace(
+ 'TYPE', type
+ ) + revision;
+
+ var a = $(document.createElement('a'));
+ $(a).attr('href', revisionUrl);
+ $(a).attr('target', '_blank');
+ $(a).text(revision);
+
+ return a;
+ },
+ addBugzillaATagsToDesc: function(desc){
+ /****
+ * Replace bugzilla bug number strings (Bug 123456) with
+ * an html <a> tag.
+ ****/
+ return desc.replace(
+ /(bug).*?(\d+)/ig,
+ '<a target="_blank" href="' + this.bugzillaUrl + "$2" +
+ '">$1 $2</a>');
+ },
setRefData: function(){
MS_PAGE.refData = {};
- MS_PAGE.refData.project = MS_PAGE.urlObj.data.seg.path[0];
- MS_PAGE.refData.branch = MS_PAGE.urlObj.data.seg.path[2];
- MS_PAGE.refData.revision = MS_PAGE.urlObj.data.seg.path[3];
+ var urlObj = MS_PAGE.urlObj.data;
+
+ MS_PAGE.refData.project = urlObj.seg.path[0];
+ MS_PAGE.refData.branch = urlObj.seg.path[2];
+ MS_PAGE.refData.revision = urlObj.seg.path[3];
+ MS_PAGE.refData.product = urlObj.param.query.product;
+ MS_PAGE.refData.branch_version = urlObj.param.query.branch_version;
+ MS_PAGE.refData.test = urlObj.param.query.test;
+ MS_PAGE.refData.platform = urlObj.param.query.platform;
+
},
getDatumKey: function(data){
/***
@@ -42,6 +83,21 @@ var MetricSummaryPage = new Class( {
key = key.hashCode();
return key;
+ },
+ getBranchUri: function(){
+
+ var url = this.branchUri + MS_PAGE.refData.branch;
+ jQuery.ajax( url, {
+ accepts:'application/json',
+ dataType:'json',
+ cache:false,
+ type:'GET',
+ context:this,
+ success: function(data, textStatus, jqXHR){
+ MS_PAGE.refData.branch_uri = data[0].uri;
+ console.log(MS_PAGE.refData.branch_uri);
+ }
+ });
}
});
@@ -51,6 +107,7 @@ $(document).ready(function() {
MS_PAGE = new MetricSummaryPage();
MS_PAGE.setRefData();
+ MS_PAGE.getBranchUri();
MS_PAGE.trendLineComponent = new TrendLineComponent();
MS_PAGE.testPagesComponent = new TestPagesComponent();
View
5 datazilla/webapp/static/js/metric_summary/TestPagesComponent.js
@@ -158,7 +158,7 @@ var TestPagesView = new Class({
},
uncheckCb: function(event, datumKey){
var id = this.cbIdPrefix + datumKey;
- $('#' + id).prop("checked", false);
+ $('#' + id).attr("checked", false);
},
tableEventHandler: function(event){
@@ -171,11 +171,12 @@ var TestPagesView = new Class({
var cells = $(row).find('td');
var meanValue = $(cells[3]).text();
- var checked = $(event.target).attr('checked');
var pagename = $(event.target).attr(this.pagenameDataAttr);
var testSuite = $(this.testSuiteSel).text();
var platform = $(this.platformSel).text();
+ var checked = $(event.target).attr('checked');
+
var eventData = {
'checked':checked,
'pagename':pagename,
View
478 datazilla/webapp/static/js/metric_summary/TrendLineComponent.js
@@ -28,9 +28,13 @@ var TrendLineComponent = new Class({
//and allows flot callback functions to map to the
//corresponding reference data in this.trendLines
this.seriesIndexToKey = [];
- this.seriesIndexToKey.push([]); //pass series
- this.seriesIndexToKey.push([]); //fail series
- this.seriesIndexToKey.push([]); //no data series
+
+ //pass series
+ this.passSeriesIndex = this.seriesIndexToKey.push([]) - 1;
+ //fail series
+ this.failSeriesIndex = this.seriesIndexToKey.push([]) - 1;
+ //no data series
+ this.noMetricsDataSeriesIndex = this.seriesIndexToKey.push([]) - 1;
this.tickDisplayDates = {};
@@ -39,8 +43,8 @@ var TrendLineComponent = new Class({
//before and after values.
this.eventData = [];
- this.pushesBefore = 50;
- this.pushesAfter = 3;
+ this.pushesBefore = 20;
+ this.pushesAfter = 5;
//true indicates push retrieval in progress
//false indicates more pushes can be retrieved
@@ -71,6 +75,18 @@ var TrendLineComponent = new Class({
'autoscaleMargin':0.1
},
+ 'series': {
+
+ 'points': {
+ 'radius': 2.5
+ }
+ },
+
+ 'selection':{
+ 'mode':'x',
+ 'color':'#BDBDBD'
+ },
+
'hooks': {
'draw':[this.draw]
} };
@@ -81,26 +97,30 @@ var TrendLineComponent = new Class({
this.defaultRowSelectionEvent = 'DEFAULT_ROW_SELECTION_EVENT';
$(this.view.chartContainerSel).bind(
- 'plotclick', _.bind(this._clickPlot, this));
+ 'plotclick', _.bind(this._clickPlot, this)
+ );
$(this.view.chartContainerSel).bind(
- 'plothover', _.bind(this._hoverPlot, this));
+ 'plothover', _.bind(this._hoverPlot, this)
+ );
+
+ $(this.view.chartContainerSel).bind(
+ 'plotselected', _.bind(this._selectPlot, this)
+ );
$(this.view.eventContainerSel).bind(
this.tableInputClickEvent,
_.bind(this.initializeTrend, this)
);
$(this.view.getPushesSel).bind(
- 'click', _.bind(this.getPushes, this));
+ 'click', _.bind(this.getPushes, this)
+ );
$(this.view.detailContainerOneSel).live(
'click mouseover mouseout', _.bind(this.closeDataSeries, this)
);
- //Set the push counts in the HTML
- this.view.setPushCounts(this.pushesBefore, this.pushesAfter);
-
$(this.view.pushesBeforeSel).bind(
'keyup', _.bind(this._handlePushAroundInput, this)
);
@@ -109,20 +129,25 @@ var TrendLineComponent = new Class({
'keyup', _.bind(this._handlePushAroundInput, this)
);
+ //Set the push counts in the HTML
+ this.view.setPushCounts(this.pushesBefore, this.pushesAfter);
+
//Simulate click on the default test suite table row
$(this.view.eventContainerSel).bind(
this.defaultRowSelectionEvent,
_.bind(this.clickTableCB, this)
);
+
},
clickTableCB: function(event, eventData){
this.simulatedTableCBClick = true;
$(eventData).click();
},
initializeTrend: function(event, eventData){
- if(this.simulatedTableCBClick){
+ if(this.simulatedTableCBClick === true){
eventData.checked = 'checked';
+ this.simulatedTableCBClick = false;
}
if( eventData.checked ){
@@ -181,8 +206,6 @@ var TrendLineComponent = new Class({
},
loadTrendData: function(data, response, eventData){
- data = this._loadMockData(data, eventData);
-
this._loadTrendLineData(data, eventData);
var chartData = [];
@@ -193,9 +216,8 @@ var TrendLineComponent = new Class({
this.tickDisplayDates = {};
- var passSeriesIndex = 0;
- var failSeriesIndex = 1;
- var noMetricsDataSeriesIndex = 2;
+ //flot data item to be passed to hoverPlot
+ var flotItem = {};
var failDataset = this.getFailDataset();
var passDataset= this.getPassDataset();
@@ -213,88 +235,126 @@ var TrendLineComponent = new Class({
var failData = [];
var trendData = [];
- var seriesColor = MS_PAGE.passColor;
+ var seriesColor = '';
var targetRevisionType = 'pass';
var trendDataset = this.getTrendLineDataset();
- var trendIndex = chartData.push(trendDataset);
+ var trendIndex = chartData.push(trendDataset) - 1;
- this.seriesIndexToKey[trendIndex - 1] = [];
+ this.seriesIndexToKey[trendIndex] = [];
var passIndex = 0;
var failIndex = 0;
var noDataIndex = 0;
- //Used as the mean for any pushes with no data
+ var metricsData = [];
for(var j=0; j<this.trendLines[key]['data'].length; j++){
+ metricsData = this.trendLines[key]['data'][j]['metrics_data'];
+
//Store x axis tick labels
if(!this.tickDisplayDates[j]){
- var unixTimestamp = this.trendLines[key]['data'][j]['date'];
- var tickLabel = this.convertTimestampToDate(unixTimestamp, false);
+
+ var tickLabel = "";
+
+ //Exclude first and last tick labels on the x-axis
+ //to keep things unclutered
+ if((j > 0) && (j <this.trendLines[key]['data'].length - 1)){
+ var unixTimestamp = this.trendLines[key]['data'][j]['date'];
+ tickLabel = this.convertTimestampToDate(
+ unixTimestamp, false
+ );
+ }
+
this.tickDisplayDates[j] = tickLabel;
}
- if(this.trendLines[key]['data'][j]['metrics_data'].length > 0){
- var pageData = this.trendLines[key]['data'][j]['metrics_data'][0]['pages'][this.trendLines[key]['pagename'] ];
+ if(metricsData.length > 0){
+ var pageData =
+ metricsData[0]['pages'][this.trendLines[key]['pagename'] ];
//Metrics data is available set trend datum
- var trendDatumIndex = chartData[trendIndex - 1].data.push(
+ var trendDatumIndex = chartData[trendIndex].data.push(
[ j, parseInt(pageData.trend_mean) ]
- );
+ ) - 1;
- this.seriesIndexToKey[trendIndex - 1][trendDatumIndex - 1] = key;
+ this.seriesIndexToKey[trendIndex][trendDatumIndex] = key;
if( pageData.test_evaluation === true ){
- passIndex = chartData[0].data.push(
+
+ //Test passed
+ passIndex = chartData[this.passSeriesIndex].data.push(
[ j, parseInt(pageData.mean) ]
- );
+ ) - 1;
+
+ this.seriesIndexToKey[this.passSeriesIndex][passIndex] = key;
- this.seriesIndexToKey[0][passIndex -1] = key;
} else if(pageData.test_evaluation === false) {
- seriesColor = MS_PAGE.failColor;
+ //Test failed
- failIndex = chartData[1].data.push(
+ failIndex = chartData[this.failSeriesIndex].data.push(
[ j, parseInt(pageData.mean) ]
- );
+ ) - 1;
- this.seriesIndexToKey[1][failIndex - 1] = key;
+ this.seriesIndexToKey[this.failSeriesIndex][failIndex] = key;
}
//revision that is loaded in the page
- if( this.trendLines[key]['data'][j]['dz_revision'] === MS_PAGE.refData.revision ){
+ if( this.trendLines[key]['data'][j]['dz_revision'] ===
+ MS_PAGE.refData.revision ){
targetRevisions.push(
{'x':j, 'y':parseInt(pageData.mean) }
);
+ flotItem.datapoint = [
+ j, pageData.mean
+ ];
+
if( pageData.test_evaluation === true ){
- this.trendLines[key].datapoint_plot_location.point_index = passIndex - 1;
+
+ seriesColor = MS_PAGE.passColor;
+
+ this.trendLines[key].datapoint_plot_location.point_index = passIndex;
+
+ flotItem.seriesIndex = this.passSeriesIndex;
+ flotItem.dataIndex =
+ this.trendLines[key].datapoint_plot_location.point_index;
+
} else {
+
targetRevisionType = 'fail';
- this.trendLines[key].datapoint_plot_location.point_index = failIndex - 1;
+
+ seriesColor = MS_PAGE.failColor;
+
+ this.trendLines[key].datapoint_plot_location.point_index = failIndex;
+
+ flotItem.seriesIndex = this.failSeriesIndex;
+ flotItem.dataIndex =
+ this.trendLines[key].datapoint_plot_location.point_index;
+
}
}
} else {
//No metrics data is available, color gray and place
//on trend line
- noDataIndex = chartData[2].data.push(
+ noDataIndex = chartData[this.noMetricsDataSeriesIndex].data.push(
[ j, parseInt(this.trendLines[key]['mean']) ]
- );
+ ) - 1;
- this.seriesIndexToKey[2][noDataIndex - 1] = key;
+ this.seriesIndexToKey[this.noMetricsDataSeriesIndex][noDataIndex] = key;
}
}
if(targetRevisionType === 'pass'){
- this.trendLines[key].datapoint_plot_location.series_index = passSeriesIndex;
+ this.trendLines[key].datapoint_plot_location.series_index = this.passSeriesIndex;
}else{
- this.trendLines[key].datapoint_plot_location.series_index = failSeriesIndex;
+ this.trendLines[key].datapoint_plot_location.series_index = this.failSeriesIndex;
}
var rgbAlpha = this.view.loadSeriesLabelContainer(
@@ -312,15 +372,22 @@ var TrendLineComponent = new Class({
this.view.drawCircleAroundDataPoints(targetRevisions, this.plot);
+ $(window).resize(
+ //Redraw the circle around target revision
+ //when the chart is resized
+ _.bind(
+ function(){
+ //this.view.drawCircleAroundDataPoints(
+ // targetRevisions, this.plot
+ // );
+ }, this)
+ );
this.unsetGetPushState();
this.view.displayDashboard();
- if(this.simulatedTableCBClick === false){
- //var datum = this.trendLines[key]['data'][ item.datapoint[0] ];
- //var key = this.seriesIndexToKey[item.seriesIndex][item.dataIndex];
- //_hoverPlot: function(event, pos, item){
- this.simulatedTableCBClick = true;
- }
+ //Set hover datum to revision of interest
+ this._hoverPlot({}, {}, flotItem);
+
},
getFailDataset: function(){
return {
@@ -422,6 +489,7 @@ var TrendLineComponent = new Class({
deleteDataSeries: function(key){
var intKey = parseInt(key);
+
for(var i=0; i<this.trendLineOrder.length; i++){
//Data series found, delete it
if( intKey === this.trendLineOrder[i] ){
@@ -436,6 +504,7 @@ var TrendLineComponent = new Class({
}
}
+ //Redraw trend lines
this.loadTrendData([], {});
},
_handlePushAroundInput: function(event){
@@ -463,27 +532,58 @@ var TrendLineComponent = new Class({
return key;
},
+ _selectPlot: function(event, ranges){
+
+ var begin = Math.ceil(ranges.xaxis.from);
+ var end = parseInt(ranges.xaxis.to);
+
+ //Don't care what the series is, just need the data index
+ //equivalent
+ var keys = _.keys(this.trendLines);
+ var rangeBegin = this.trendLines[keys[0]]['data'][begin]['revisions'][0]['revision'];
+ var rangeEnd = this.trendLines[keys[0]]['data'][end]['revisions'][0]['revision'];
+
+ //Retrieve the url for the get range href
+ var url = this.model.getPushRangeUrl(rangeBegin, rangeEnd);
+
+ //Set the inputs and href
+ this.view.setPushRange(rangeBegin, rangeEnd, url);
+
+ },
_hoverPlot: function(event, pos, item){
if(item){
+
//Check if the datum display is locked
var checked = $(this.view.datumLockSel).attr('checked');
if(checked){
//Datum locked, do nothing
return;
}
+ //Highlight the datapoint that the datum info is initialized to
+ this.plot.unhighlight();
+
+ this.plot.highlight(item.seriesIndex, item.datapoint);
+
+ if(item.dataIndex === undefined){
+ //dataIndex must be defined to proceed
+ return;
+ }
+
var key = this.seriesIndexToKey[item.seriesIndex][item.dataIndex];
if(key != this.hoverLegendKey){
var lastKey = this.hoverLegendKey || key;
//User has hovered directly from a point on series a
//to a point on series b, we need to set the point on
//series a back to the appropriate background color
- this.view.unhighlightLegend(
- this.trendLines[lastKey].rgb_alpha,
- this.hoverLegendEl
- );
+ if(this.trendLines[lastKey] != undefined){
+ this.view.unhighlightLegend(
+ this.trendLines[lastKey].rgb_alpha,
+ this.hoverLegendEl
+ );
+ }
}
this.hoverLegendKey = key;
@@ -503,47 +603,49 @@ var TrendLineComponent = new Class({
this.view.highlightLegend(legendEl);
var metricKeys = [
- 'mean', 'trend_mean', 'stddev', 'trend_stddev',
- 'p', 'fdr', 'h0_rejected', 'n_replicates' ];
+ 'test_evaluation', 'mean', 'trend_mean', 'stddev',
+ 'trend_stddev', 'p', 'fdr', 'h0_rejected', 'n_replicates' ];
//If the dz_revision is not defined, data metrics datum has not
//been received in datazilla, use the first revision associated
//with the push.
+ var revision = datum.dz_revision || datum.revisions[0]['revision'];
+ var revisionHtml = MS_PAGE.getHgUrlATag('rev', revision);
+
keyValueArray.push(
{'label':'dz_revision',
- 'value':[datum.dz_revision ||
- datum.revisions[0]['revision'] ] });
+ 'value':revisionHtml });
keyValueArray.push(
{'label':'author',
- 'value':[datum.user]});
+ 'value':datum.user});
keyValueArray.push(
{'label':'date',
- 'value':[this.convertTimestampToDate(datum.date, true)]});
+ 'value':this.convertTimestampToDate(datum.date, true)});
keyValueArray.push(
{'label':'branch',
- 'value':[datum.branch_name]});
+ 'value':datum.branch_name});
keyValueArray.push(
{'label':'test suite',
- 'value':[dataSeries.testsuite]});
+ 'value':dataSeries.testsuite});
keyValueArray.push(
{'label':'page',
- 'value':[pagename]});
+ 'value':pagename});
var color = MS_PAGE.passColor;
if(datum.metrics_data.length > 0){
-
+ //Load metrics specific data
for(var i=0; i<metricKeys.length; i++){
var mk = metricKeys[i];
keyValueArray.push(
- {'label':mk,
- 'value':[datum.metrics_data[0]['pages'][pagename][mk] ] });
+ {'label':mk.replace('_', ' '),
+ 'value':datum.metrics_data[0]['pages'][pagename][mk] });
}
if( datum.metrics_data[0]['pages'][pagename]['test_evaluation'] === false ){
@@ -559,18 +661,42 @@ var TrendLineComponent = new Class({
var revisionDatum = datum.revisions[i];
+ var changesetHtml = MS_PAGE.getHgUrlATag(
+ 'changeset', revisionDatum.revision
+ );
+
revisionKeyValues.push(
{'label':'revision',
- 'value':[revisionDatum.revision]});
- revisionKeyValues.push(
- {'label':'author',
- 'value':[revisionDatum.author]});
+ 'value':changesetHtml});
+
+ var contactInfo = revisionDatum.author.match(/(.*?)\<(\S+)\>/);
+
+ var email = "";
+ var author = "";
+
+ if(contactInfo.length === 3){
+ revisionKeyValues.push(
+ {'label':'author',
+ 'value':contactInfo[1]});
+ revisionKeyValues.push(
+ {'label':'email',
+ 'value':contactInfo[2]});
+
+ }else{
+ revisionKeyValues.push(
+ {'label':'author',
+ 'value':revisionDatum.author});
+ }
+
+ var desc = MS_PAGE.addBugzillaATagsToDesc(revisionDatum.desc);
+
revisionKeyValues.push(
{'label':'desc',
- 'value':[revisionDatum.desc]});
+ 'value':desc});
}
- var url = this.model.getRawDataUrl(this.trendLines[key]);
+ var url = this.model.getRawDataUrl(
+ this.trendLines[key], datum.revisions[0].revision);
var rgbAlpha = this.view.hexToRgb(color);
@@ -582,13 +708,14 @@ var TrendLineComponent = new Class({
if(this.hoverLegendKey && this.hoverLegendEl){
- this.view.unhighlightLegend(
- this.trendLines[this.hoverLegendKey].rgb_alpha,
- this.hoverLegendEl
- );
-
- this.hoverLegendKey = undefined;
- this.hoverLegendEl = undefined;
+ if(this.trendLines[this.hoverLegendKey] != undefined){
+ this.view.unhighlightLegend(
+ this.trendLines[this.hoverLegendKey].rgb_alpha,
+ this.hoverLegendEl
+ );
+ this.hoverLegendKey = undefined;
+ this.hoverLegendEl = undefined;
+ }
}
}
},
@@ -603,59 +730,29 @@ var TrendLineComponent = new Class({
var key = MS_PAGE.getDatumKey(eventData);
+ var mean = eventData.mean;
+
+ if(this.trendLines[key]){
+ mean = this.trendLines[key].mean;
+ }
+
this.trendLines[key] = {
- pagename:eventData.pagename,
- testsuite:eventData.testsuite,
- platform:eventData.platform,
- platform_info:eventData.platform_info,
- data:data,
- rgb_alpha:"",
+ 'pagename':eventData.pagename,
+ 'testsuite':eventData.testsuite,
+ 'platform':eventData.platform,
+ 'platform_info':eventData.platform_info,
+ 'data':data,
+ 'rgb_alpha':"",
//This is the mean for the revision of interest. It's
//used by pushes with no metrics data to place them along
//side the revision of interest.
- mean: eventData.mean,
- datapoint_plot_location:{
+ 'mean': mean,
+ 'datapoint_plot_location':{
'series_index':0, 'point_index':0
}
};
}
},
- _loadMockData: function(data, eventData){
-
- var datum = {};
- var datumIndex = 0;
-
- for(var i=0; i<data.length; i++){
- if( data[i]['metrics_data'].length > 0 ){
- datum = data[i];
- datumIndex = i;
- }
- }
- for(var i=0; i<data.length; i++){
- if( datumIndex != i ){
-
- var datumClone = jQuery.extend(true, {}, datum);
- var mean = parseInt(datumClone['metrics_data'][0].pages[eventData.pagename ].mean);
- var trendMean = parseInt(datumClone['metrics_data'][0].pages[eventData.pagename ].trend_mean);
-
- //mean = Math.floor(Math.random() * (mean - (mean - 5) + 1)) + (mean - 5);
- //trendMean = Math.floor(Math.random() * (trendMean - (trendMean - 5) + 1)) + (trendMean - 5);
-
- datumClone['metrics_data'][0].pages[eventData.pagename ].mean = parseInt(mean);
- datumClone['metrics_data'][0].pages[eventData.pagename ].trend_mean = parseInt(trendMean);
- datumClone['metrics_data'][0].pages[eventData.pagename ].test_evaluation = true;
-
- datumClone.dz_revision = 'SomeOtherRevision';
-
- data[i] = datumClone;
- }
- var pushlogId = parseInt(datumClone['metrics_data'][0].pages[eventData.pagename ]['pushlog_id']);
- datumClone['metrics_data'][0].pages[eventData.pagename ]['pushlog_id'] = pushlogId + i;
- }
-
- return data;
- },
-
dataLoadError: function(data, textStatus, jqXHR){
var messageText = 'Ohhh no, something has gone horribly wrong! ';
@@ -681,6 +778,7 @@ var TrendLineView = new Class({
this.pushlogDashboardSel = '#su_pushlog_dashboard';
this.eventContainerSel = '#su_container';
+ this.pushesAroundRevisionSel = '#su_pushes_around_rev';
this.chartContainerSel = '#su_trendline_plot';
this.detailContainerOneSel = '#su_graph_detail_container_1';
this.datumLockSel = '#su_lock_datum';
@@ -689,12 +787,19 @@ var TrendLineView = new Class({
this.pushesAfterSel = '#su_pushes_after';
this.getPushSpinnerSel = '#su_get_pushes_spinner';
+ this.pushRangeBeginSel = '#su_push_range_begin';
+ this.pushRangeEndSel = '#su_push_range_end';
+
this.datumRevision = '#su_datum_revision';
this.datumRawDataAnchor = '#su_raw_data';
this.detailContainerTwoSel = '#su_graph_detail_container_2';
this.detailContainerThreeSel = '#su_graph_detail_container_3';
this.datumControls = '#su_datum_controls';
+ this.lightTextClass = 'su-light-text';
+ this.datumValueClass = 'su-datum-value';
+ this.patchDescriptionClass = 'su-datum-desc-value';
+
this.datumDisplayContainers = [
this.datumRevision, this.datumControls,
this.detailContainerTwoSel, this.detailContainerThreeSel
@@ -715,7 +820,15 @@ var TrendLineView = new Class({
this.getPushesSel = '#su_get_pushes';
$(this.getPushesSel).button();
+ this.getPushRangeSel = '#su_get_range';
+ $(this.getPushRangeSel).button();
+
this.dashboardDisplayed = false;
+
+
+ //Set the pushes around revision
+ $(this.pushesAroundRevisionSel).text(MS_PAGE.refData.revision);
+
},
displayDashboard: function(){
if(this.dashboardDisplayed === false){
@@ -805,14 +918,12 @@ var TrendLineView = new Class({
return rgbAlpha;
},
loadDatumLabelContainer: function(
- datumKeyValues, revisionKeyValues, url, rgbAlpha, color){
+ datumKeyValues, revisionKeyValues, url, rgbAlpha, color
+ ){
$(this.detailContainerTwoSel).empty();
$(this.detailContainerThreeSel).empty();
- var datumTable = $(document.createElement('table'));
-
-$(datumTable).css('width', 170);
$(this.datumRawDataAnchor).attr('href', url);
$(this.datumRawDataAnchor).button();
@@ -823,61 +934,69 @@ $(datumTable).css('width', 170);
}
this.setDatumKeyValues(
- datumKeyValues, datumTable, this.detailContainerTwoSel
+ datumKeyValues, this.detailContainerTwoSel
);
- var revisionTable = $(document.createElement('table'));
-
this.setDatumKeyValues(
- revisionKeyValues, revisionTable, this.detailContainerThreeSel
+ revisionKeyValues, this.detailContainerThreeSel
);
},
- setDatumKeyValues: function(datumKeyValues, datumTable, container){
+ setDatumKeyValues: function(datumKeyValues, container){
+
+ var containerWidth = $(container).css('width');
for(var i=0; i<datumKeyValues.length; i++){
var datum = datumKeyValues[i];
var label = datum['label'];
- var values = datum['value'];
+ var value = datum['value'];
if(label === 'dz_revision'){
- $(this.datumRevision).text(values[0]);
+ //This is the revision in the push that's found in
+ //datazilla. Set the datum revision to it.
+ $(this.datumRevision).html(value);
continue;
}
- var rowspan = datumKeyValues[i].length;
+ var dataDiv = $(document.createElement('div'));
+ $(dataDiv).css('width', containerWidth);
- var tr = $(document.createElement('tr'));
- var th = $(document.createElement('th'));
+ if(label === 'desc'){
+ //The revision description fields can be really large
+ //make the text lighter to give some visual distinction
+ $(dataDiv).addClass(this.lightTextClass);
+ $(dataDiv).addClass(this.patchDescriptionClass);
+ $(dataDiv).html(value);
+ $(container).append(dataDiv);
+ continue;
+ }
- $(th).text(label);
- $(th).css('text-align', 'right');
- $(th).addClass('su-light-text');
- $(tr).append(th);
+ //Create/set the label span
+ var labelSpan = $(document.createElement('span'));
- $(th).attr('rowspan', rowspan);
+ $(labelSpan).css('text-align', 'left');
+ $(labelSpan).addClass(this.lightTextClass);
- for(var j=0; j<values.length; j++){
- var td = $(document.createElement('td'));
- $(td).css('text-align', 'right');
- $(td).text(values[j]);
+ $(labelSpan).text(label);
+ $(dataDiv).append(labelSpan);
- if(j === 0){
- $(tr).append(td);
- $(datumTable).append(tr);
- }else{
- var newRow = $(document.createElement('tr'));
- var emptyTd = $(document.createElement('td'));
- $(newRow).append(emptyTd);
- $(newRow).append(td);
- $(datumTable).append(newRow);
- }
+ //Create/set the value span
+ var valueSpan = $(document.createElement('span'));
+
+ $(valueSpan).addClass(this.datumValueClass);
+
+ if(label === 'revision'){
+ $(valueSpan).html(value);
+ }else{
+ $(valueSpan).text(value);
}
- }
+ $(dataDiv).append(valueSpan);
- $(container).append(datumTable);
+ //Load the data div into the container
+ $(container).append(dataDiv);
+ }
},
getSeriesId: function(key){
return this.legendIdPrefix + key;
@@ -918,6 +1037,13 @@ $(datumTable).css('width', 170);
$(this.pushesAfterSel).val(pushesAfter);
},
+ setPushRange: function(rangeBegin, rangeEnd, url){
+
+ $(this.pushRangeBeginSel).val(rangeBegin);
+ $(this.pushRangeEndSel).val(rangeEnd);
+ $(this.getPushRangeSel).attr('href', url);
+
+ },
getPushCounts: function(){
var counts = {};
counts.before = $(this.pushesBeforeSel).val();
@@ -939,6 +1065,16 @@ var TrendLineModel = new Class({
this.parent(options);
+ this.pushlogUrl = '/' + MS_PAGE.refData.project +
+ '/testdata/metrics/' + MS_PAGE.refData.branch + '/' +
+ MS_PAGE.refData.revision + '/pushlog';
+
+ this.rawDataUrl = '/' + MS_PAGE.refData.project +
+ '/testdata/raw/' + MS_PAGE.refData.branch + '/';
+
+ this.pushRangeUrl = "https://hg.mozilla.org/URI/pushloghtml?" +
+ "fromchange=BEGIN&tochange=END";
+
},
getTrendLine: function(
context, fnSuccess, fnError, eventData, pushesBefore, pushesAfter
@@ -960,38 +1096,42 @@ var TrendLineModel = new Class({
},
getMetricsUrl: function(data, pushesBefore, pushesAfter){
- var url = '/' + MS_PAGE.refData.project +
- '/testdata/metrics/' + MS_PAGE.refData.branch + '/' +
- MS_PAGE.refData.revision + '/pushlog';
-
- url = this.getUri(data, url);
+ var url = this.getUri(data, this.pushlogUrl);
url += '&pushes_before=' + pushesBefore;
url += '&pushes_after=' + pushesAfter;
return url;
},
- getRawDataUrl: function(data){
+ getRawDataUrl: function(data, revision){
- var url = '/' + MS_PAGE.refData.project +
- '/testdata/raw/' + MS_PAGE.refData.branch + '/' +
- MS_PAGE.refData.revision;
-
- url = this.getUri(data, url);
+ var url = this.getUri(data, this.rawDataUrl + revision);
return url;
},
getUri: function(data, url){
- url += '?os_name=' + data.platform_info.operating_system_name;
+ url += '?product=' + MS_PAGE.refData.product;
+ url += '&branch_version=' + MS_PAGE.refData.branch_version;
+ url += '&os_name=' + data.platform_info.operating_system_name;
url += '&os_version=' + data.platform_info.operating_system_version;
url += '&processor=' + data.platform_info.processor;
url += '&build_type=' + data.platform_info.type;
url += '&test_name=' + data.testsuite;
url += '&page_name=' + data.pagename;
return url;
+ },
+ getPushRangeUrl: function(rangeBegin, rangeEnd){
+
+ var url = this.pushRangeUrl.replace(
+ 'URI', MS_PAGE.refData.branch_uri
+ );
+ url = url.replace('BEGIN', rangeBegin);
+ url = url.replace('END', rangeEnd);
+ return url;
+
}
});
View
34 datazilla/webapp/templates/metrics.summary.html
@@ -42,12 +42,19 @@
<div id="su_main_gauge_container" class="su-main-gauge">
<div id="su_gauge_1"></div>
- <div class="su-reference-info" style="width:200px; display:none;">
- <div><span class="su-light-text2">Product:</span>&nbsp;<span id="su_product_tested" style="float:right;" class="su-light-text"></span></div>
- <div><span class="su-light-text2">Revision:</span>&nbsp;<span id="su_revision_tested" style="float:right;" class="su-light-text"></span></div>
+ <div class="su-reference-info" style="width:245px; display:none;">
+ <div><span class="su-light-text2">Product:</span>
+ <select id="su_revision_products" size="1" style="float:right;"></select>
+ </div>
+ <div style="margin-top:5px;"><span class="su-light-text2">Revision:</span>&nbsp;<span id="su_revision_tested" style="float:right;" class="su-light-text"></span></div>
+ <div><span class="su-light-text2">Author:</span>&nbsp;<span id="su_push_author" style="float:right;" class="su-light-text"></span></div>
<div><span class="su-light-text2">Talos Test Count:</span>&nbsp;<span id="su_total_count" style="float:right;" class="su-light-text"></span></div>
<div><span class="su-light-text2">Tests Without Trend:</span>&nbsp;<span id="su_no_trend_count" style="float:right;" class="su-light-text"></span></div>
<div><span class="su-light-text2">Results:</span>&nbsp;<span style="float:right;"><span id="su_pass_count" class="su-pass-color"></span>,&nbsp;<span id="su_fail_count" class="su-fail-color"></span></span></div>
+
+ <div id="su_push_desc" style="text-align:center; margin-top:10px; overflow-y:auto; height:65px;" class="su-light-text">
+ <div id="su_push_desc"></div>
+ </div>
</div>
</div>
@@ -80,7 +87,7 @@
</div>
</div>
</div>
- <div id="su_table_container" style="float:right; width:400px; height:380px; margin-top:25px;">
+ <div id="su_table_container" style="float:right; width:42%; height:380px; margin-top:25px;">
<div style="font-size:13px; float:left;"><span class="su-light-text2">Test Suite:</span><span id="su_test_suite" class="su-light-text"></span><span style="margin-left:15px;" class="su-light-text2">Platform:</span><span id="su_platform" class="su-light-text"></span></div>
<table id="su_test_pages" cellpadding="0" cellspacing="0" border="0" class="display"></table>
</div>
@@ -97,21 +104,26 @@
<h2 style="margin-left:185px;">Revision Pushlog</h2>
- <div style="margin-left:185px; margin-bottom:50px;"><div style="float:left; margin-top:5px;" >Pushes Around <span id="su_pushes_around_rev"></span>: before<input id="su_pushes_before" type="text" size="3" maxlength="3" style="margin-left:3px; margin-right:5px;"/>after:<input id="su_pushes_after" type="text" size="3" maxlength="3" style="margin-left:3px; margin-right:3px;"/></div><button id="su_get_pushes" style="float:left; margin-left:8px; margin-top:3px;">Get Pushes</button><div id="su_get_pushes_spinner" style="float:left; margin-left:3px; display:none;" class="su-small-spinner"></div></div>
+ <div style="margin-left:185px; margin-bottom:50px;">
+ <div style="float:left; margin-top:5px;" >Pushes Around <span id="su_pushes_around_rev"></span>: before<input id="su_pushes_before" type="text" size="3" maxlength="3" style="margin-left:3px; margin-right:5px;"/>after:<input id="su_pushes_after" type="text" size="3" maxlength="3" style="margin-left:3px; margin-right:3px;"/></div><button id="su_get_pushes" style="float:left; margin-left:8px; margin-top:3px;">Get Pushes</button><div id="su_get_pushes_spinner" style="float:left; margin-left:3px; display:none;" class="su-small-spinner"></div>
+ </div>
<div class="ui-helper-clearfix"></div>
<div id="su_graph_detail_container_1" class="ui-widget css-left" style="width:135px; overflow-y:auto; height:380px; display:block;"></div>
<div class="su-vertical-text">Mean (milliseconds)</div>
<div id="su_trendline_plot" style="margin-left:30px; margin-bottom:20px; float:left; height:350px; width:600px;"></div>
- <div style="overflow-y:auto; height: 380px; display: block; float:right; width:200px;">
- <div id="su_datum_revision" text-align="center" class="ui-state-highlight ui-corner-all su-datum-info-panel css-right su-large-text"></div>
+ <div style="width:250px; position:absolute; left:760px; top:880px; opacity:0.6;" class="ui-widget ui-corner-all arrow_box_up">
+ <div style="font-size:13px; margin-top:10px; margin-bottom:10px; margin-left:10px; margin-right:10px;">Tip: Select a row above to load a test page series.</div>
+ </div>
+ <div style="overflow-y:auto; height: 380px; margin-left:3px; float:left; width:220px;">
+ <div id="su_datum_revision" style="width:187px; text-align:right;" class="ui-state-highlight ui-corner-all su-datum-info-panel css-right su-large-text"></div>
<div id="su_datum_controls" class="ui-state-highlight ui-corner-all su-datum-info-panel css-right su-light-text">Lock Push:<input id="su_lock_datum" type="checkbox" /><div style="float:right;"><a id="su_raw_data" target="_blank" href="#">Get Raw Data</a></div></div>
<div id="su_graph_detail_container_2" class="ui-state-highlight ui-corner-all su-datum-info-panel css-right"></div>
<div id="su_graph_detail_container_3" class="ui-state-highlight ui-corner-all su-datum-info-panel css-right"></div>
</div>
<div class="ui-helper-clearfix"></div>
- <div style="margin-left:185px; margin-bottom:3px;">Repository (hg.mozilla.org) Push Range: begin<input type="text" size="12" style="margin-left:3px; margin-right:5px;"/>end:<input type="text" size="12" style="margin-left:3px; margin-right:3px;"/><button id="su_get_range" style="margin-left:8px;">Get Range</button></div>
+ <div style="margin-left:185px; margin-bottom:3px;">Repository (hg.mozilla.org) Push Range: begin<input id="su_push_range_begin" type="text" size="12" style="margin-left:3px; margin-right:5px;"/>end:<input id="su_push_range_end" type="text" size="12" style="margin-left:3px; margin-right:3px;"/><a id="su_get_range" style="margin-left:8px;" target="_blank" href="#">Get Range</a></div>
</div>
</div>
</div> <!-- End su_container -->
@@ -129,20 +141,18 @@ <h2 style="margin-left:185px;">Revision Pushlog</h2>
<script type="text/javascript" src="/static/js/plugins/jquery.url.js"></script>
<script type="text/javascript" src="/static/js/plugins/flot-0.7/jquery.flot.min.js"></script>
+<script type="text/javascript" src="/static/js/plugins/flot-0.7/jquery.flot.selection.min.js"></script>
+<!-- <script type="text/javascript" src="/static/js/plugins/flot-0.7/jquery.flot.resize.min.js"></script> -->
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="/static/js/plugins/flot-0.7/excanvas.min.js"></script><![endif]-->
<script type="text/javascript" src="/static/js/plugins/underscore-min.js"></script>
-<script type="text/javascript" src="/static/js/plugins/d3.v2.min.js"></script>
<script type="text/javascript" src="/static/js/plugins/box.js"></script>
<!-- Gives core mootools class functionality to jQuery -->
<script type="text/javascript" src="/static/js/plugins/mootools-core-1.4.0.js"></script>
<script type="text/javascript" src="/static/js/plugins/moo4q/Source/Class.Mutators.jQuery.js"></script>
<script type="text/javascript" src="/static/js/plugins/datatables/jquery.dataTables.min.js"></script>
-
-
-<!-- This version of fg.menu.js has been heavily modified to work in bughunter -->
<script type="text/javascript" src="/static/js/plugins/json2.js"></script>
<!-- gages -->
View
1 datazilla/webapp/urls.py
@@ -28,7 +28,6 @@
#revision metrics summary
(r'^(?P<project>\w+)/summary/?', include('datazilla.webapp.apps.summary.urls')),
-
#datazilla web service
(r'^(?P<project>\w+)/?', include('datazilla.webapp.apps.datazilla.urls')),

0 comments on commit e5f9fbd

Please sign in to comment.
Something went wrong with that request. Please try again.