[llvm-commits] [zorg] r121245 - in /zorg/trunk/lnt/lnt/viewer: GraphUtil.py simple.ptl

Daniel Dunbar daniel at zuster.org
Wed Dec 8 00:40:45 PST 2010


Author: ddunbar
Date: Wed Dec  8 02:40:45 2010
New Revision: 121245

URL: http://llvm.org/viewvc/llvm-project?rev=121245&view=rev
Log:
LNT/simple: Add view options to allow showing standard deviation error bars on
graphs.

Modified:
    zorg/trunk/lnt/lnt/viewer/GraphUtil.py
    zorg/trunk/lnt/lnt/viewer/simple.ptl

Modified: zorg/trunk/lnt/lnt/viewer/GraphUtil.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/GraphUtil.py?rev=121245&r1=121244&r2=121245&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/GraphUtil.py (original)
+++ zorg/trunk/lnt/lnt/viewer/GraphUtil.py Wed Dec  8 02:40:45 2010
@@ -10,7 +10,7 @@
 
 def get_test_plots(db, machine, test_ids, run_summary, ts_summary,
                    show_mad_error = False, show_points = False,
-                   show_all_points = False):
+                   show_all_points = False, show_stddev = False):
     # Load all the samples for these tests and this machine.
     q = db.session.query(Sample.run_id,Sample.test_id,
                          Sample.value).join(Run)
@@ -59,6 +59,10 @@
                         points_data.append((x, v))
                 else:
                     points_data.append((x, min_value))
+            if show_stddev:
+                mean = stats.mean(values)
+                sigma = stats.standard_deviation(values)
+                errorbar_data.append((x, mean - sigma, mean + sigma))
             if show_mad_error:
                 med = stats.median(values)
                 mad = stats.median_absolute_deviation(values, med)

Modified: zorg/trunk/lnt/lnt/viewer/simple.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/simple.ptl?rev=121245&r1=121244&r2=121245&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/simple.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/simple.ptl Wed Dec  8 02:40:45 2010
@@ -223,6 +223,22 @@
     def graph [html] (self):
         request = quixote.get_request()
 
+        # Get the view options form.
+        form = quixote.form.Form(method=str("get"))
+        form.add(quixote.form.CheckboxWidget, "show_mad", True,
+                 title="Show MAD")
+        form.add(quixote.form.CheckboxWidget, "show_stddev", False,
+                 title="Show Standard Deviation")
+
+        # Add all the hidden fields.
+        for name,value in request.form.items():
+            if (name.startswith(str('test.')) or name.startswith(str('pset.'))):
+                form.add(quixote.form.HiddenWidget, name, value)
+
+        form.add_submit("submit", "Update")
+
+        # Get the form values.
+
         # Get a DB connection.
         db = self.root.getDB()
 
@@ -233,6 +249,8 @@
         ts_summary = perfdbsummary.get_simple_suite_summary(db, self.tag)
 
         # Load the form data.
+        show_stddev =  bool(form['show_stddev'])
+        show_mad = bool(form['show_mad'])
         graph_tests = []
         graph_psets = []
         for name,value in request.form.items():
@@ -255,7 +273,8 @@
         plots = ""
         plots_iter = GraphUtil.get_test_plots(db, machine, test_ids,
                                               run_summary, ts_summary,
-                                              show_mad_error = True,
+                                              show_mad_error = show_mad,
+                                              show_stddev = show_stddev,
                                               show_points = True)
         for test_id, plot_js, col, points, ext_points in plots_iter:
             test = db.getTest(test_id)
@@ -268,6 +287,11 @@
             plot_points.append(ext_points)
 
         def graph_body [html] ():
+            # Show the view options form.
+            self.renderPopupBegin('view_options', 'View Options', True)
+            form.render()
+            self.renderPopupEnd()
+
             """
             <h3>Graph</h3>
             <table>
@@ -447,7 +471,7 @@
         ts_summary = perfdbsummary.get_simple_suite_summary(db, self.tag)
         sri = runinfo.SimpleRunInfo(db, ts_summary)
 
-        # Get the filtering form.
+        # Get the view options form.
         form = quixote.form.Form(method=str("get"))
         form.add(quixote.form.CheckboxWidget, "show_delta",
                  title="Show Delta")





More information about the llvm-commits mailing list