[LNT] r275102 - Expose regression graph data limits to the user
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 11 14:00:37 PDT 2016
Author: cmatthews
Date: Mon Jul 11 16:00:36 2016
New Revision: 275102
URL: http://llvm.org/viewvc/llvm-project?rev=275102&view=rev
Log:
Expose regression graph data limits to the user
Modified:
lnt/trunk/lnt/server/ui/api.py
lnt/trunk/lnt/server/ui/static/lnt_graph.js
lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html
lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html
Modified: lnt/trunk/lnt/server/ui/api.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/api.py?rev=275102&r1=275101&r2=275102&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/api.py (original)
+++ lnt/trunk/lnt/server/ui/api.py Mon Jul 11 16:00:36 2016
@@ -189,7 +189,8 @@ class Graph(Resource):
limit = request.args.get('limit', None)
if limit:
limit = int(limit)
- q = q.limit(limit)
+ if limit:
+ q = q.limit(limit)
samples = [[rev, val, {'label': rev, 'date': str(time), 'runID': str(rid)}] for val, rev, time, rid in q.all()[::-1]]
Modified: lnt/trunk/lnt/server/ui/static/lnt_graph.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/lnt_graph.js?rev=275102&r1=275101&r2=275102&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/static/lnt_graph.js (original)
+++ lnt/trunk/lnt/server/ui/static/lnt_graph.js Mon Jul 11 16:00:36 2016
@@ -23,11 +23,9 @@ var lnt_graph = {};
// Grab the graph API url for this line.
-function get_api_url(kind, db, ts, mtf, limit) {
+function get_api_url(kind, db, ts, mtf) {
"use strict";
- var url = [prefix, "api", "db_" + db, "v4", ts, kind, mtf].join('/');
- url += "?limit=" + limit;
- return url;
+ return [prefix, "api", "db_" + db, "v4", ts, kind, mtf].join('/');
}
// Grab the URL for a regression by id.
@@ -343,12 +341,12 @@ function update_graph() {
}
// To be called by main page. It will fetch data and make graph ready.
-function add_data_to_graph(URL, index) {
+function add_data_to_graph(URL, index, max_samples) {
"use strict";
- $.getJSON(get_api_url("graph", db_name, test_suite_name, URL, 350), function (data) {
+ $.getJSON(get_api_url("graph", db_name, test_suite_name, URL) + "?limit=" + max_samples, function (data) {
new_graph_data_callback(data, index);
});
- $.getJSON(get_api_url("regression", db_name, test_suite_name, URL, 350), function (data) {
+ $.getJSON(get_api_url("regression", db_name, test_suite_name, URL) + "?limit=" + max_samples, function (data) {
new_graph_regression_callback(data, index, update_graph);
});
is_checked[index] = true;
Modified: lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html?rev=275102&r1=275101&r2=275102&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html Mon Jul 11 16:00:36 2016
@@ -285,7 +285,8 @@ function register_checkboxes() {
var color = color_codes[index % color_codes.length];
var prev_cell = $(this).closest('td').prev();
prev_cell.css("background-color", color);
- add_data_to_graph(changes[index]["url"], index);
+ add_data_to_graph(changes[index]["url"], index,
+ {{ request.args.get("limit", 350) }});
} else {
is_checked[index] = false;
var prev_cell = $(this).closest('td').prev();
Modified: lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html?rev=275102&r1=275101&r2=275102&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html Mon Jul 11 16:00:36 2016
@@ -38,7 +38,7 @@
var g = {};
var test_suite_name = "{{ testsuite_name }}";
var db_name = "{{ request.view_args.get('db_name','') }}";
-
+var max_samples = {{ request.args.get('limit', 350) }};
var changes = [
{% for form_change in form.field_changes%}
{% set fc = changes[loop.index -1] %}
@@ -221,7 +221,7 @@ function register_checkboxes() {
var color = color_codes[index % color_codes.length];
var prev_cell = $(this).closest('td').prev();
prev_cell.css("background-color", color);
- add_data_to_graph(changes[index]["url"], index, update_graph);
+ add_data_to_graph(changes[index]["url"], index, max_samples);
} else {
is_checked[index] = false;
var prev_cell = $(this).closest('td').prev();
@@ -280,7 +280,9 @@ function update_order_summary() {
} else {
$(SIDE_BAR).append("<b>No intersection</b></br>");
}
-
+
+ $(SIDE_BAR).append("<br><b><a href=\"?limit=1000\">More data</a></b></br>");
+ $(SIDE_BAR).append("<b><a href=\"?limit=0\">All data</a></b></br>");
}
var dt = null;
More information about the llvm-commits
mailing list