[LNT] r311755 - Move shared PrecomputedCR class to lnt.server.ui.util; NFC
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 24 19:32:52 PDT 2017
Author: matze
Date: Thu Aug 24 19:32:52 2017
New Revision: 311755
URL: http://llvm.org/viewvc/llvm-project?rev=311755&view=rev
Log:
Move shared PrecomputedCR class to lnt.server.ui.util; NFC
Modified:
lnt/trunk/lnt/server/ui/regression_views.py
lnt/trunk/lnt/server/ui/util.py
lnt/trunk/lnt/server/ui/views.py
Modified: lnt/trunk/lnt/server/ui/regression_views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/regression_views.py?rev=311755&r1=311754&r2=311755&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/regression_views.py (original)
+++ lnt/trunk/lnt/server/ui/regression_views.py Thu Aug 24 19:32:52 2017
@@ -19,8 +19,7 @@ import lnt.server.reporting.analysis
from lnt.server.ui.globals import v4_url_for
from lnt.util import logger
-from lnt.server.ui.util import FLASH_DANGER, FLASH_SUCCESS
-from lnt.server.reporting.analysis import REGRESSED
+from lnt.server.ui.util import FLASH_DANGER, FLASH_SUCCESS, PrecomputedCR
import lnt.server.db.fieldchange
from lnt.server.db.regression import RegressionState, new_regression
from lnt.server.db.regression import get_first_runs_of_fieldchange
@@ -49,30 +48,6 @@ def get_fieldchange(ts, id):
return ts.query(ts.FieldChange).filter(ts.FieldChange.id == id).one()
-class PrecomputedCR():
- """Make a thing that looks like a comprison result, that is derived
- from a field change."""
- previous = 0
- current = 0
- pct_delta = 0.00
- bigger_is_better = False
-
- def __init__(self, old, new, bigger_is_better):
- self.previous = old
- self.current = new
- self.delta = new - old
- self.pct_delta = self.delta / old
-
- def get_test_status(self):
- return True
-
- def get_value_status(self, ignore_small=True):
- return REGRESSED
-
- def __json__(self):
- return self.__dict__
-
-
@v4_route("/regressions/new", methods=["GET", "POST"])
def v4_new_regressions():
form = TriagePageSelectedForm(request.form)
Modified: lnt/trunk/lnt/server/ui/util.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/util.py?rev=311755&r1=311754&r2=311755&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/util.py (original)
+++ lnt/trunk/lnt/server/ui/util.py Thu Aug 24 19:32:52 2017
@@ -1,6 +1,7 @@
import colorsys
import math
import re
+from lnt.server.reporting.analysis import REGRESSED
from flask import g
@@ -279,3 +280,27 @@ def convert_revision(dotted):
"""
dotted = integral_rex.findall(dotted)
return tuple([int(d) for d in dotted])
+
+
+class PrecomputedCR():
+ """Make a thing that looks like a comprison result, that is derived
+ from a field change."""
+ previous = 0
+ current = 0
+ pct_delta = 0.00
+ bigger_is_better = False
+
+ def __init__(self, old, new, bigger_is_better):
+ self.previous = old
+ self.current = new
+ self.delta = new - old
+ self.pct_delta = self.delta / old
+
+ def get_test_status(self):
+ return True
+
+ def get_value_status(self, ignore_small=True):
+ return REGRESSED
+
+ def __json__(self):
+ return self.__dict__
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=311755&r1=311754&r2=311755&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Thu Aug 24 19:32:52 2017
@@ -36,8 +36,8 @@ import lnt.util.stats
from lnt.server.reporting.analysis import ComparisonResult, calc_geomean
from lnt.server.ui.decorators import frontend, db_route, v4_route
from lnt.server.ui.globals import db_url_for, v4_url_for
-from lnt.server.ui.regression_views import PrecomputedCR
from lnt.server.ui.util import FLASH_DANGER, FLASH_SUCCESS, FLASH_INFO
+from lnt.server.ui.util import PrecomputedCR
from lnt.server.ui.util import mean
from lnt.util import async_ops
from lnt.util import logger
More information about the llvm-commits
mailing list