[LNT] r216547 - Label the test name if there are more than one plot
Yi Kong
Yi.Kong at arm.com
Wed Aug 27 06:47:48 PDT 2014
Author: kongyi
Date: Wed Aug 27 08:47:48 2014
New Revision: 216547
URL: http://llvm.org/viewvc/llvm-project?rev=216547&view=rev
Log:
Label the test name if there are more than one plot
This helps distingushing data points when plotting multiple graphs, especially
when data points on not on the trend line, for example show all points.
Modified:
lnt/trunk/lnt/server/ui/templates/v4_graph.html
lnt/trunk/lnt/server/ui/views.py
Modified: lnt/trunk/lnt/server/ui/templates/v4_graph.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_graph.html?rev=216547&r1=216546&r2=216547&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_graph.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_graph.html Wed Aug 27 08:47:48 2014
@@ -140,6 +140,10 @@ function show_tooltip(x, y, item, pos, g
var meta_data = extract_metadata(item, graph_data);
var tip_body = '<div id="tooltip">';
+ if ("test_name" in meta_data) {
+ tip_body += "<b>Test:</b> " + meta_data.test_name + "<br>";
+ }
+
if ("label" in meta_data) {
tip_body += "<b>Revision:</b> " + meta_data.label + "<br>";
}
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=216547&r1=216546&r2=216547&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Wed Aug 27 08:47:48 2014
@@ -592,7 +592,7 @@ def v4_graph():
data = util.multidict((rev, (val, date)) for val,rev,date in q).items()
data.sort(key=lambda sample: convert_revision(sample[0]))
- graph_datum.append((data, col))
+ graph_datum.append((test.name, data, col))
# Get baselines for this line
num_baselines = len(baseline_parameters)
@@ -626,9 +626,10 @@ def v4_graph():
# Draw mean trend if requested.
if mean_parameter:
machine, field = mean_parameter
+ test_name = 'Mean'
col = (0,0,0)
- legend.append((machine, 'Mean', field.name, col))
+ legend.append((machine, test_name, field.name, col))
q = ts.query(sqlalchemy.sql.func.min(field.column),
ts.Order.llvm_project_revision,
@@ -646,9 +647,9 @@ def v4_graph():
# Sort data points according to revision number.
data.sort(key=lambda sample: convert_revision(sample[0]))
- graph_datum.append((data, col))
+ graph_datum.append((test_name, data, col))
- for data, col in graph_datum:
+ for name, data, col in graph_datum:
# Compute the graph points.
errorbar_data = []
points_data = []
@@ -668,8 +669,6 @@ def v4_graph():
# And the date on which they were taken.
dates = [data_date[1] for data_date in datapoints]
- metadata = {"label":point_label}
-
# When we can, map x-axis to revisions, but when that is too hard
# use the position of the sample instead.
rev_x = convert_revision(point_label)
@@ -677,7 +676,15 @@ def v4_graph():
values = [v*normalize_by for v in data]
min_value,min_index = min((value, index) for (index, value) in enumerate(values))
+
+ # Generate metadata.
+ metadata = {"label":point_label}
metadata["date"] = str(dates[min_index])
+ if len(graph_datum) > 1:
+ # If there are more than one plot in the graph, also label the
+ # test name.
+ metadata["test_name"] = name
+
pts.append((x, min_value, metadata))
# Add the individual points, if requested.
More information about the llvm-commits
mailing list