[llvm-commits] [zorg] r130220 - /zorg/trunk/lnt/lnt/server/ui/views.py

Daniel Dunbar daniel at zuster.org
Tue Apr 26 10:48:23 PDT 2011


Author: ddunbar
Date: Tue Apr 26 12:48:23 2011
New Revision: 130220

URL: http://llvm.org/viewvc/llvm-project?rev=130220&view=rev
Log:
LNT/Flask: Port simple schema's report and text_report pages.

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

Modified: zorg/trunk/lnt/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/views.py?rev=130220&r1=130219&r2=130220&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/views.py (original)
+++ zorg/trunk/lnt/lnt/server/ui/views.py Tue Apr 26 12:48:23 2011
@@ -4,6 +4,7 @@
 from flask import abort
 from flask import current_app
 from flask import g
+from flask import make_response
 from flask import redirect
 from flask import render_template
 from flask import request
@@ -155,16 +156,13 @@
     return render_template("simple_machine.html", tag=tag, id=id,
                            associated_runs=associated_runs)
 
- at db_route("/simple/<tag>/<id>")
-def simple_run(tag, id):
+def get_simple_run_info(tag, id):
     db = request.get_db()
 
     run = db.getRun(id)
 
     # Get the run summary.
     run_summary = perfdbsummary.SimpleSuiteRunSummary.get_summary(db, tag)
-    ts_summary = perfdbsummary.get_simple_suite_summary(db, tag)
-    sri = runinfo.SimpleRunInfo(db, ts_summary)
 
     # Get the comparison run.
     compare_to = None
@@ -179,6 +177,41 @@
         if prev_id is not None:
             compare_to = db.getRun(prev_id)
 
+    return db, run, run_summary, compare_to
+
+ at db_route("/simple/<tag>/<id>/report")
+def simple_report(tag, id):
+    db, run, run_summary, compare_to = get_simple_run_info(tag, id)
+
+    show_graphs = bool(request.args.get('show_graphs'))
+    _, _, html_report = NTEmailReport.getSimpleReport(
+        None, db, run, str("%s/db_%s/") % (current_app.old_config.zorgURL,
+                                           g.db_name),
+        True, True, show_graphs = show_graphs)
+
+    return make_response(html_report)
+
+ at db_route("/simple/<tag>/<id>/text_report")
+def simple_text_report(tag, id):
+    db, run, run_summary, compare_to = get_simple_run_info(tag, id)
+
+    _, text_report, _ = NTEmailReport.getSimpleReport(
+        None, db, run, str("%s/db_%s/") % (current_app.old_config.zorgURL,
+                                           g.db_name),
+        True, True)
+
+    response = make_response(text_report)
+    response.mimetype = "text/plain"
+    return response
+
+ at db_route("/simple/<tag>/<id>")
+def simple_run(tag, id):
+    db, run, run_summary, compare_to = get_simple_run_info(tag, id)
+
+    # Get additional summaries.
+    ts_summary = perfdbsummary.get_simple_suite_summary(db, tag)
+    sri = runinfo.SimpleRunInfo(db, ts_summary)
+
     # Get the neighboring runs.
     cur_id = run.id
     for i in range(3):
@@ -195,7 +228,6 @@
 
     # Parse the view options.
     options = {}
-    options['show_graphs'] = bool(request.args.get('show_graphs'))
     options['show_delta'] = bool(request.args.get('show_delta'))
     options['show_stddev'] =  bool(request.args.get('show_stddev'))
     options['show_mad'] = bool(request.args.get('show_mad'))





More information about the llvm-commits mailing list