[LNT] r305246 - Make the Run page JSON more naturally pandas compatible

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 16:06:21 PDT 2017


Author: cmatthews
Date: Mon Jun 12 18:06:21 2017
New Revision: 305246

URL: http://llvm.org/viewvc/llvm-project?rev=305246&view=rev
Log:
Make the Run page JSON more naturally pandas compatible

I don't think this page's JSON output is used by anyone. Right now,
it requires a lot of transformation to get the data into a Pandas
DataFrame for analysis.  This change moves fields around so that Pandas
naturally extracts all the data from the run page's json.

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=305246&r1=305245&r2=305246&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Mon Jun 12 18:06:21 2017
@@ -469,17 +469,17 @@ def v4_run(id):
         reported_tests = ts.query(ts.Test.name, ts.Test.id).\
             filter(ts.Run.id == id).\
             filter(ts.Test.id.in_(sri.test_ids)).all()
+        order = run.order.as_ordered_string()
 
-        json_obj['tests'] = {}
         for test_name, test_id in reported_tests:
-            test = {}
-            test['name'] = test_name
+            test = dict(test_name=test_name, test_id=test_id,
+                        order=order, machine=run.machine.name)
             for sample_field in ts.sample_fields:
                 res = sri.get_run_comparison_result(
                     run, None, test_id, sample_field,
                     ts.Sample.get_hash_of_binary_field())
                 test[sample_field.name] = res.current
-            json_obj['tests'][test_id] = test
+            json_obj[test_name] = test
 
         return flask.jsonify(**json_obj)
 




More information about the llvm-commits mailing list