Skip to content

Commit cfc8483

Browse files
committed
Include Run ID in Geomean graphs
The logic for displaying the Run ID in the per-point metadata already exists since it is already done for normal data points, so extend the existing Geomean query to also include this information. Since the Run ID information is now always present, additionally remove several if-conditions that were previously used to handle it being missing. Change-Id: Iaa3406553286c5a4dc697a279559a14d482da926
1 parent 898e036 commit cfc8483

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

lnt/server/ui/views.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -997,30 +997,31 @@ def load_geomean_data(field, machine, limit, xaxis_date, revision_cache=None):
997997
ts = request.get_testsuite()
998998
values = session.query(sqlalchemy.sql.func.min(field.column),
999999
ts.Order,
1000-
sqlalchemy.sql.func.min(ts.Run.start_time)) \
1000+
ts.Run.start_time,
1001+
ts.Run.id) \
10011002
.filter(ts.Run.order_id == ts.Order.id) \
10021003
.filter(ts.Run.id == ts.Sample.run_id) \
10031004
.filter(ts.Test.id == ts.Sample.test_id) \
10041005
.filter(ts.Run.machine_id == machine.id) \
10051006
.filter(field.column.isnot(None)) \
1006-
.group_by(ts.Order.llvm_project_revision, ts.Test, ts.Order.id)
1007+
.group_by(ts.Order.llvm_project_revision, ts.Test, ts.Order.id, ts.Run.id)
10071008

10081009
if limit:
10091010
values = values.limit(limit)
10101011

10111012
data = multidict.multidict(
1012-
((order, date), val)
1013-
for val, order, date in values).items()
1013+
((order, date, run_id), val)
1014+
for val, order, date, run_id in values).items()
10141015

10151016
# Calculate geomean of each revision.
10161017
if xaxis_date:
1017-
data = [(date, [(calc_geomean(vals), order, date)])
1018-
for ((order, date), vals) in data]
1018+
data = [(date, [(calc_geomean(vals), order, date, run_id)])
1019+
for ((order, date, run_id), vals) in data]
10191020
# Sort data points according to date.
10201021
data.sort(key=lambda sample: sample[0])
10211022
else:
1022-
data = [(order.llvm_project_revision, [(calc_geomean(vals), order, date)])
1023-
for ((order, date), vals) in data]
1023+
data = [(order.llvm_project_revision, [(calc_geomean(vals), order, date, run_id)])
1024+
for ((order, date, run_id), vals) in data]
10241025
# Sort data points according to order (revision).
10251026
data.sort(key=lambda sample: convert_revision(sample[0], cache=revision_cache))
10261027

@@ -1235,7 +1236,7 @@ def trace_group(test_name, field_name, machine):
12351236
# And the date on which they were taken.
12361237
dates = [data_array[2] for data_array in datapoints]
12371238
# Run ID where this point was collected.
1238-
run_ids = [data_array[3] for data_array in datapoints if len(data_array) == 4]
1239+
run_ids = [data_array[3] for data_array in datapoints]
12391240

12401241
values = [v * normalize_by for v in values]
12411242

@@ -1260,20 +1261,17 @@ def trace_group(test_name, field_name, machine):
12601261
# Generate point metadata.
12611262
point_metadata = {"order": orders[agg_index].as_ordered_string(),
12621263
"orderID": orders[agg_index].id,
1263-
"date": str(dates[agg_index])}
1264-
if run_ids:
1265-
point_metadata["runID"] = str(run_ids[agg_index])
1266-
1264+
"date": str(dates[agg_index]),
1265+
"runID": str(run_ids[agg_index])}
12671266
meta.append(point_metadata)
12681267

12691268
# Add the multisample points, if requested.
12701269
if not hide_all_points and is_multisample:
12711270
for i, v in enumerate(values):
12721271
multisample_metadata = {"order": orders[i].as_ordered_string(),
12731272
"orderID": orders[i].id,
1274-
"date": str(dates[i])}
1275-
if run_ids:
1276-
multisample_metadata["runID"] = str(run_ids[i])
1273+
"date": str(dates[i]),
1274+
"runID": str(run_ids[i])}
12771275
multisample_points_data["x"].append(point_label)
12781276
multisample_points_data["y"].append(v)
12791277
multisample_points_data["meta"].append(multisample_metadata)

0 commit comments

Comments
 (0)