[llvm-commits] [LNT] r161833 - /lnt/trunk/lnt/server/ui/views.py

Michael Gottesman mgottesman at apple.com
Mon Aug 13 21:20:41 PDT 2012


Author: mgottesman
Date: Mon Aug 13 23:20:41 2012
New Revision: 161833

URL: http://llvm.org/viewvc/llvm-project?rev=161833&view=rev
Log:
[LNT] v4_global_status: Added code to handle field/revision arguments.

A field argument is either 2 or 3. 2 is for compile time and 3 is for
execution time.

Revision is just an int as well.

Modified:
    lnt/trunk/lnt/server/ui/views.py

Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161833&r1=161832&r2=161833&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 23:20:41 2012
@@ -645,12 +645,15 @@
 
     # Create a datetime for the day before the most recent run.
     yesterday = latest_date - datetime.timedelta(days=1)
-
-    # Get the revision number for the default baseline and look up
-    # the fields we are interested in.
-    revision = ts.Machine.DEFAULT_BASELINE_REVISION
-    field = ts.Sample.get_primary_fields().next()
-
+    
+    # Get arguments.
+    revision = int(request.args.get('revision',
+                                    ts.Machine.DEFAULT_BASELINE_REVISION))
+    field = int(request.args.get('field', 2)) # 2 is for compile time
+    # FIXME: This maybe could be done in itertools or we could maybe
+    # return an actual list that is populated lazily.
+    field = [x for x in ts.Sample.get_primary_fields()][field-2]
+    
     # Get the list of all runs we might be interested in.
     recent_runs = ts.query(ts.Run).filter(ts.Run.start_time > yesterday).all()
 





More information about the llvm-commits mailing list