Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1080)

Unified Diff: tools/telemetry/telemetry/page/page_measurement_value.py

Issue 22754003: Refactor BenchmarkResult.Add to take enum for data_type (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/page/page_measurement_value.py
===================================================================
--- tools/telemetry/telemetry/page/page_measurement_value.py (revision 222891)
+++ tools/telemetry/telemetry/page/page_measurement_value.py (working copy)
@@ -1,8 +1,14 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from telemetry.page import perf_tests_helper
+from telemetry.core import util
+
+# Get build scripts into our path.
+util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'util', 'lib')
+from common import perf_result_data_type # pylint: disable=F0401
+from common import perf_tests_results_helper # pylint: disable=F0401
+
def _Mean(l):
return float(sum(l)) / len(l) if len(l) > 0 else 0.0
@@ -23,8 +29,9 @@
@property
def output_value(self):
- if 'histogram' in self.data_type:
- (mean, _) = perf_tests_helper.GeomMeanAndStdDevFromHistogram(self.value)
+ if perf_result_data_type.IsHistogram(self.data_type):
+ (mean, _) = (perf_tests_results_helper
+ .GeomMeanAndStdDevFromHistogram(self.value))
return mean
elif isinstance(self.value, list):
return _Mean(self.value)

Powered by Google App Engine
This is Rietveld 408576698