Skip to content

Commit 66b46df

Browse files
author
Pavel Kosov
committed
Update graph API to return the original string revision as X values
api/db_default/v4/nts/graph is used to request regression points on fly using JS. We still use convert_revision() for sorting, but return the original (unchanged) values. It must be done before refactoring to use the library plotly. OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg Reviewed By: cmatthews Differential Revision: https://reviews.llvm.org/D114333
1 parent 3a546ee commit 66b46df

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

lnt/server/ui/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,11 @@ def get(machine_id, test_id, field_index):
456456
q = q.limit(limit)
457457

458458
samples = [
459-
[convert_revision(rev), val,
459+
[rev, val,
460460
{'label': rev, 'date': str(time), 'runID': str(rid)}]
461461
for val, rev, time, rid in q.all()[::-1]
462462
]
463-
samples.sort(key=lambda x: x[0])
463+
samples.sort(key=lambda x: convert_revision(x[0]))
464464
return samples
465465

466466

lnt/server/ui/templates/v4_new_regressions.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
{% set fc = changes[loop.index -1] %}
3737
{% set fc_ri_field_index = ts.get_field_index(fc.ri.field) %}
3838
{"url": "/{{api_graph}}/{{ fc.ri.machine.id}}/{{fc.ri.test.id}}/{{fc_ri_field_index}}",
39-
"start": {{fc.ri.start_order.llvm_project_revision}},
40-
"end": {{fc.ri.end_order.llvm_project_revision}}
39+
"start": "{{fc.ri.start_order.as_ordered_string()}}",
40+
"end": "{{fc.ri.end_order.as_ordered_string()}}"
4141
},
4242
{% endfor %}
4343
];

lnt/server/ui/templates/v4_regression_detail.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
{% set fc = changes[loop.index -1] %}
4444
{% set fc_ri_field_index = ts.get_field_index(fc.ri.field) %}
4545
{"url": "{{fc.ri.machine.id}}/{{fc.ri.test.id}}/{{fc_ri_field_index}}",
46-
"start": {{fc.ri.start_order.llvm_project_revision}},
47-
"end": {{fc.ri.end_order.llvm_project_revision}}
46+
"start": "{{fc.ri.start_order.as_ordered_string()}}",
47+
"end": "{{fc.ri.end_order.as_ordered_string()}}"
4848
},
4949
{% endfor %}
5050
];

tests/server/ui/test_api.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@
4141
u'test_id': 1,
4242
u'compile_time': 0.007}
4343

44-
graph_data = [[[152292], 1.0,
45-
{u'date': u'2012-05-01 16:28:23',
46-
u'label': u'152292',
47-
u'runID': u'5'}],
48-
[[152293], 10.0,
44+
graph_data = [[u'152292', 1.0,
45+
{u'date': u'2012-05-01 16:28:23',
46+
u'label': u'152292',
47+
u'runID': u'5'}],
48+
[u'152293', 10.0,
49+
{u'date': u'2012-05-03 16:28:24',
50+
u'label': u'152293',
51+
u'runID': u'6'}]]
52+
53+
graph_data2 = [[u'152293', 10.0,
4954
{u'date': u'2012-05-03 16:28:24',
5055
u'label': u'152293',
5156
u'runID': u'6'}]]
5257

53-
graph_data2 = [[[152293], 10.0,
54-
{u'date': u'2012-05-03 16:28:24',
55-
u'label': u'152293',
56-
u'runID': u'6'}]]
57-
5858
possible_run_keys = {
5959
u'ARCH',
6060
u'CC_UNDER_TEST_IS_CLANG',

0 commit comments

Comments
 (0)