[llvm-commits] [zorg] r151328 - /zorg/trunk/lnt/lnt/server/reporting/runs.py

Daniel Dunbar daniel at zuster.org
Thu Feb 23 16:58:12 PST 2012


Author: ddunbar
Date: Thu Feb 23 18:58:12 2012
New Revision: 151328

URL: http://llvm.org/viewvc/llvm-project?rev=151328&view=rev
Log:
[lnt] lnt.server.reporting: Add a quick hack to derive a baseline one when none is provided.
 - For now, this just picks a baseline close to a random LLVM rev (r144168). In the future this will probably be moved into the UI somewhere.

Modified:
    zorg/trunk/lnt/lnt/server/reporting/runs.py

Modified: zorg/trunk/lnt/lnt/server/reporting/runs.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/reporting/runs.py?rev=151328&r1=151327&r2=151328&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/reporting/runs.py (original)
+++ zorg/trunk/lnt/lnt/server/reporting/runs.py Thu Feb 23 18:58:12 2012
@@ -31,6 +31,28 @@
     machine = run.machine
     machine_parameters = machine.parameters
 
+    # If no baseline was given, find one close to the requested baseline run
+    # order.
+    if baseline is None:
+        # Find the closest order to the requested baseline order, for which this
+        # machine also reported.
+        #
+        # FIXME: Scalability! Pretty fast in practice, but still pretty lame.
+        order_to_find = ts.Order(llvm_project_revision = '% 7d' % 144168)
+        best = None
+        for order in ts.query(ts.Order).\
+                join(ts.Run).\
+                filter(ts.Run.machine == machine).distinct():
+            if order >= order_to_find and (best is None or order < best):
+                best = order
+
+        # Find the most recent run on this machine that used that order.
+        if best:
+            baseline = ts.query(ts.Run).\
+                filter(ts.Run.machine == run.machine).\
+                filter(ts.Run.order == best).\
+                order_by(ts.Run.start_time.desc()).first()
+
     # Gather the runs to use for statistical data.
     if comparison_window is None:
         comparison_start_run = compare_to or run
@@ -426,7 +448,7 @@
 
         if secondary_info:
             a_cr = secondary_info[(name,field)]
-            if cr.stddev is not None:
+            if a_cr.stddev is not None:
                 a_stddev_value = "%.4f" % a_cr.stddev
             else:
                 a_stddev_value = "-"





More information about the llvm-commits mailing list