[LNT] r194518 - Add a json interface to the Summary Report view.

Chris Matthews cmatthews5 at apple.com
Tue Nov 12 13:50:30 PST 2013


Author: cmatthews
Date: Tue Nov 12 15:50:30 2013
New Revision: 194518

URL: http://llvm.org/viewvc/llvm-project?rev=194518&view=rev
Log:
Add a json interface to the Summary Report view.

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=194518&r1=194517&r2=194518&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Tue Nov 12 15:50:30 2013
@@ -926,4 +926,16 @@ You must define a summary report configu
     # Build the report.
     report.build()
 
+    if bool(request.args.get('json')):
+        json_obj = dict()
+        json_obj['ticks'] = report.report_orders
+        data = []
+        for e in report.normalized_data_table.items():
+            header, samples = e
+            raw_samples = samples.getvalue()
+            data.append([header, raw_samples])
+        json_obj['data'] = data
+
+        return flask.jsonify(**json_obj)
+
     return render_template("v4_summary_report.html", report=report)





More information about the llvm-commits mailing list