diff options
author | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-10 21:09:05 +0000 |
---|---|---|
committer | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-10 21:09:05 +0000 |
commit | 57775427ef173f1b5a4ab6a7b9cbf7d096f0c98c (patch) | |
tree | 3eebba31077574e758bf3294cb87cb6a3e71c139 /tools/perf | |
parent | 396361315d2d4170c89bb9adb398807d220ace3e (diff) | |
download | chromium_src-57775427ef173f1b5a4ab6a7b9cbf7d096f0c98c.zip chromium_src-57775427ef173f1b5a4ab6a7b9cbf7d096f0c98c.tar.gz chromium_src-57775427ef173f1b5a4ab6a7b9cbf7d096f0c98c.tar.bz2 |
cc: Remove cheapness prediction benchmark.
BUG=235995
Review URL: https://chromiumcodereview.appspot.com/14487009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/perf_tools/cheapness_predictor_measurement.py | 42 | ||||
-rw-r--r-- | tools/perf/perf_tools/cheapness_predictor_metrics.py | 86 |
2 files changed, 0 insertions, 128 deletions
diff --git a/tools/perf/perf_tools/cheapness_predictor_measurement.py b/tools/perf/perf_tools/cheapness_predictor_measurement.py deleted file mode 100644 index cf175b5..0000000 --- a/tools/perf/perf_tools/cheapness_predictor_measurement.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2013 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 perf_tools import cheapness_predictor_metrics -from telemetry.page import page_measurement - -PREDICTOR_STATS = [ - {'name': 'picture_pile_count', 'units': ''}, - {'name': 'predictor_accuracy', 'units': 'percent'}, - {'name': 'predictor_safely_wrong_count', 'units': ''}, - {'name': 'predictor_badly_wrong_count', 'units': ''}] - -class CheapnessPredictorMeasurement(page_measurement.PageMeasurement): - def __init__(self): - super(CheapnessPredictorMeasurement, self).__init__('smoothness') - self._metrics = None - - def CustomizeBrowserOptions(self, options): - options.AppendExtraBrowserArg('--dom-automation') - options.AppendExtraBrowserArg('--enable-prediction-benchmarking') - options.AppendExtraBrowserArg('--enable-gpu-benchmarking') - options.AppendExtraBrowserArg('--enable-threaded-compositing') - options.AppendExtraBrowserArg('--enable-impl-side-painting') - - def DidNavigateToPage(self, page, tab): - self._metrics = \ - cheapness_predictor_metrics.CheapnessPredictorMetrics(tab) - self._metrics.GatherInitialStats() - - def DidRunAction(self, page, tab, action): - self._metrics.GatherDeltaStats() - - def CanRunForPage(self, page): - return hasattr(page, 'smoothness') - - def MeasurePage(self, page, tab, results): - predictor_stats = self._metrics.stats - - for stat_to_gather in PREDICTOR_STATS: - results.Add(stat_to_gather['name'], - stat_to_gather['units'], - predictor_stats[stat_to_gather['name']]) diff --git a/tools/perf/perf_tools/cheapness_predictor_metrics.py b/tools/perf/perf_tools/cheapness_predictor_metrics.py deleted file mode 100644 index 2fc14c3..0000000 --- a/tools/perf/perf_tools/cheapness_predictor_metrics.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (c) 2013 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. -import json - -class CheapnessPredictorMetrics(object): - def __init__(self, tab): - self._tab = tab - self._initial_stats = {} - self.stats = {} - - def GatherInitialStats(self): - self._initial_stats = self._GatherStats() - - def GatherDeltaStats(self): - final_stats = self._GatherStats() - - correct_count = final_stats['predictor_correct_count'] - \ - self._initial_stats['predictor_correct_count'] - - incorrect_count = final_stats['predictor_incorrect_count'] - \ - self._initial_stats['predictor_incorrect_count'] - - percent, total = self._GetPercentAndTotal(correct_count, incorrect_count) - - self.stats['picture_pile_count'] = total - self.stats['predictor_correct_count'] = correct_count - self.stats['predictor_incorrect_count'] = incorrect_count - self.stats['predictor_accuracy'] = percent - self.stats['predictor_safely_wrong_count'] = \ - final_stats['predictor_safely_wrong_count'] - \ - self._initial_stats['predictor_safely_wrong_count'] - self.stats['predictor_badly_wrong_count'] = \ - final_stats['predictor_badly_wrong_count'] - \ - self._initial_stats['predictor_badly_wrong_count'] - - def _GatherStats(self): - stats = {} - - incorrect_count, correct_count = \ - self._GetBooleanHistogramCounts(self._tab, - 'Renderer4.CheapPredictorAccuracy') - - percent, total = self._GetPercentAndTotal(correct_count, incorrect_count) - stats['picture_pile_count'] = total - stats['predictor_correct_count'] = correct_count - stats['predictor_incorrect_count'] = incorrect_count - stats['predictor_accuracy'] = percent - - _, safely_wrong_count = \ - self._GetBooleanHistogramCounts(self._tab, - 'Renderer4.CheapPredictorSafelyWrong') - stats['predictor_safely_wrong_count'] = safely_wrong_count - - _, badly_wrong_count = \ - self._GetBooleanHistogramCounts(self._tab, - 'Renderer4.CheapPredictorBadlyWrong') - stats['predictor_badly_wrong_count'] = badly_wrong_count - - return stats - - - def _GetPercentAndTotal(self, correct_count, incorrect_count): - total = incorrect_count + correct_count - percent = 0 - if total > 0: - percent = 100 * correct_count / float(total) - return percent, total - - def _GetBooleanHistogramCounts(self, tab, histogram_name): - count = [0, 0] - js = ('window.domAutomationController.getHistogram ? ' - 'window.domAutomationController.getHistogram(' - '"%s") : ""' % (histogram_name)) - data = tab.EvaluateJavaScript(js) - if not data: - return count - - histogram = json.loads(data) - if histogram: - for bucket in histogram['buckets']: - if bucket['low'] > 1: - continue - count[bucket['low']] += bucket['count'] - - return count |