[LNT] r305736 - When possible use the numeric version of the order
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 19 12:52:00 PDT 2017
Author: cmatthews
Date: Mon Jun 19 14:52:00 2017
New Revision: 305736
URL: http://llvm.org/viewvc/llvm-project?rev=305736&view=rev
Log:
When possible use the numeric version of the order
In some graphs, we were not using the numeric version of the order,
when it existed, this lead to strange sorting problems in the regression
view.
Modified:
lnt/trunk/lnt/server/ui/api.py
lnt/trunk/lnt/server/ui/util.py
lnt/trunk/lnt/server/ui/views.py
lnt/trunk/tests/server/ui/test_api.py
Modified: lnt/trunk/lnt/server/ui/api.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/api.py?rev=305736&r1=305735&r2=305736&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/api.py (original)
+++ lnt/trunk/lnt/server/ui/api.py Mon Jun 19 14:52:00 2017
@@ -7,6 +7,7 @@ from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import NoResultFound
from lnt.testing import PASS
+from lnt.server.ui.util import convert_revision
parser = reqparse.RequestParser()
parser.add_argument('db', type=str)
@@ -215,7 +216,7 @@ class Graph(Resource):
if limit:
q = q.limit(limit)
- samples = [[rev, val, {'label': rev, 'date': str(time), 'runID': str(rid)}] for val, rev, time, rid in
+ samples = [[convert_revision(rev), val, {'label': rev, 'date': str(time), 'runID': str(rid)}] for val, rev, time, rid in
q.all()[::-1]]
return samples
Modified: lnt/trunk/lnt/server/ui/util.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/util.py?rev=305736&r1=305735&r2=305736&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/util.py (original)
+++ lnt/trunk/lnt/server/ui/util.py Mon Jun 19 14:52:00 2017
@@ -363,3 +363,16 @@ def baseline_key(ts_name=None):
else:
name = g.db_name
return "baseline-{}-{}".format(name, g.db_name)
+
+
+integral_rex = re.compile(r"[\d]+")
+
+
+def convert_revision(dotted):
+ """Turn a version number like 489.2.10 into something
+ that is ordered and sortable.
+ For now 489.2.10 will be returned as a tuple of ints.
+ """
+ dotted = integral_rex.findall(dotted)
+ return tuple([int(d) for d in dotted])
+
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=305736&r1=305735&r2=305736&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Mon Jun 19 14:52:00 2017
@@ -41,9 +41,7 @@ from lnt.server.ui.regression_views impo
from lnt.server.ui.util import FLASH_DANGER, FLASH_SUCCESS
from lnt.server.ui.util import mean
from lnt.util import async_ops
-from lnt.server.ui.util import baseline_key
-
-integral_rex = re.compile(r"[\d]+")
+from lnt.server.ui.util import baseline_key, convert_revision
# http://flask.pocoo.org/snippets/62/
@@ -668,14 +666,6 @@ def v4_graph():
request.args.get('hide_highlight'))
show_highlight = not options['hide_highlight']
- def convert_revision(dotted):
- """Turn a version number like 489.2.10 into something
- that is ordered and sortable.
- For now 489.2.10 will be returned as a tuple of ints.
- """
- dotted = integral_rex.findall(dotted)
- return tuple([int(d) for d in dotted])
-
# Load the graph parameters.
graph_parameters = []
for name,value in request.args.items():
Modified: lnt/trunk/tests/server/ui/test_api.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/test_api.py?rev=305736&r1=305735&r2=305736&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/test_api.py (original)
+++ lnt/trunk/tests/server/ui/test_api.py Mon Jun 19 14:52:00 2017
@@ -35,16 +35,16 @@ order_expected_response = {u'id': 1,
u'next_order_id': 0,
u'previous_order_id': 2}
-graph_data = [[u'152292', 1.0,
+graph_data = [[[152292], 1.0,
{u'date': u'2012-05-01 16:28:23',
u'label': u'152292',
u'runID': u'5'}],
- [u'152293', 10.0,
+ [[152293], 10.0,
{u'date': u'2012-05-03 16:28:24',
u'label': u'152293',
u'runID': u'6'}]]
-graph_data2 = [[u'152293', 10.0,
+graph_data2 = [[[152293], 10.0,
{u'date': u'2012-05-03 16:28:24',
u'label': u'152293',
u'runID': u'6'}]]
More information about the llvm-commits
mailing list