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) |