[LNT] r209118 - Add geometric mean to run reports
Duncan P. N. Exon Smith
dexonsmith at apple.com
Fri May 23 14:19:53 PDT 2014
> On 2014-May-19, at 03:36, Yi Kong <Yi.Kong at arm.com> wrote:
>
> Author: kongyi
> Date: Mon May 19 05:36:54 2014
> New Revision: 209118
>
> URL: http://llvm.org/viewvc/llvm-project?rev=209118&view=rev
> Log:
> Add geometric mean to run reports
>
> Modified:
> lnt/trunk/lnt/server/reporting/analysis.py
> lnt/trunk/lnt/server/ui/templates/v4_run.html
>
> Modified: lnt/trunk/lnt/server/reporting/analysis.py
> URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/reporting/analysis.py?rev=209118&r1=209117&r2=209118&view=diff
> ==============================================================================
> --- lnt/trunk/lnt/server/reporting/analysis.py (original)
> +++ lnt/trunk/lnt/server/reporting/analysis.py Mon May 19 05:36:54 2014
> @@ -256,6 +256,40 @@ class RunInfo(object):
> stddev_mean, stddev_is_estimated,
> self.confidence_lv)
>
> + def get_geomean_comparison_result(self, run, compare_to, field,
> + comparison_window=[]):
> + # FIXME: Geometric mean does not take 0 values, so fix it by adding 1
> + # to each value and substract 1 from the result. Since we are only
> + # interested in the change of data set, this workaround is good enough,
> + # but not ideal.
> + run_samples = filter(None,
> + [self.sample_map.get((run.id, test_id))
> + for test_id in self.get_test_ids()])
> + run_values = [self.aggregation_fn(a[field.index] + 1
> + for a in e) for e in run_samples]
> +
> + prev_samples = filter(None,
> + [self.sample_map.get((run.id, test_id))
> + for test_id in self.get_test_ids()])
> + prev_values = [self.aggregation_fn(a[field.index] + 1
> + for a in e) for e in prev_samples]
> +
> + run_geomean = util.geometric_mean(run_values) - 1
> + prev_geomean = util.geometric_mean(prev_values) - 1
> +
> + delta = run_geomean - prev_geomean
> + if prev_geomean != 0:
> + pct_delta = delta / prev_geomean
> + else:
> + pct_delta = 0.0
> +
> + return ComparisonResult(run_geomean, prev_geomean, delta,
> + pct_delta, stddev = None, MAD = None,
> + cur_failed = False, prev_failed = False,
> + samples = [run_geomean],
> + prev_samples = [prev_geomean],
> + confidence_lv = 0)
> +
> def _load_samples_for_runs(self, run_ids):
> # Find the set of new runs to load.
> to_load = set(run_ids) - self.loaded_run_ids
>
> Modified: lnt/trunk/lnt/server/ui/templates/v4_run.html
> URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_run.html?rev=209118&r1=209117&r2=209118&view=diff
> ==============================================================================
> --- lnt/trunk/lnt/server/ui/templates/v4_run.html (original)
> +++ lnt/trunk/lnt/server/ui/templates/v4_run.html Mon May 19 05:36:54 2014
> @@ -321,6 +321,13 @@
> {% endif %}
> {% endfor %}
> </tbody>
> + <tfoot>
> + {% set cr = request_info.sri.get_geomean_comparison_result(
> + run, compare_to, field, request_info.comparison_window) %}
> + <td></td>
> + <td>Mean</td>
> + {{ get_cell_value(cr) }}
> + </tfoot>
> </table>
> {{ utils.render_popup_end() }}
> {% endfor %}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
I'm getting a crash in the webserver when looking at "view results" on compile
tests. Here's the backtrace:
2014-05-23 14:09:59 ERROR: Exception on /db_default/v4/compile/13 [GET]
Traceback (most recent call last):
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Volumes/Data/lnt/lnt/lnt/server/ui/decorators.py", line 67, in wrap
result = f(**args)
File "/Volumes/Data/lnt/lnt/lnt/server/ui/views.py", line 353, in v4_run
request_info=info)
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/templating.py", line 128, in render_template
context, ctx.app)
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/templating.py", line 110, in _render
rv = template.render(context)
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Jinja2-2.7.2-py2.7.egg/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/Volumes/Data/lnt/sandbox/lib/python2.7/site-packages/Jinja2-2.7.2-py2.7.egg/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Volumes/Data/lnt/lnt/lnt/server/ui/templates/v4_run.html", line 82, in top-level template code
<td>{{cr.get_samples()|length}}</td>
File "/Volumes/Data/lnt/lnt/lnt/server/ui/templates/layout.html", line 168, in top-level template code
{% block body %}{% endblock %}
File "/Volumes/Data/lnt/lnt/lnt/server/ui/templates/v4_run.html", line 325, in block "body"
{% set cr = request_info.sri.get_geomean_comparison_result(
File "/Volumes/Data/lnt/lnt/lnt/server/reporting/analysis.py", line 251, in get_geomean_comparison_result
for a in e) for e in run_samples]
File "/Volumes/Data/lnt/lnt/lnt/server/reporting/analysis.py", line 251, in <genexpr>
for a in e) for e in run_samples]
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
127.0.0.1 - - [23/May/2014 14:09:59] "GET /db_default/v4/compile/13 HTTP/1.1" 500 -
I checked out the revision *before* this commit and everything is fine there.
Can you have a look?
More information about the llvm-commits
mailing list