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

Side by Side Diff: tools/perf/contrib/cros_benchmarks/tab_switching_measure.py

Issue 2890333002: Tab Switching Benchmark for ChromeOS (Closed)
Patch Set: Tab Switching Benchmark for ChromeOS Created 3 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """The tab switching measurement.
6
7 This measurement record the MPArch.RWH_TabSwitchPaintDuration histogram
8 of each tab swithcing.
9 """
10
11 from telemetry.page import legacy_page_test
12 from telemetry.value import histogram
13 from telemetry.value import histogram_util
14
15 from contrib.cros_benchmarks import cros_utils
16
17
18 class CrosTabSwitchingMeasurement(legacy_page_test.LegacyPageTest):
19 """Measures tab switching performance."""
20
21 def __init__(self):
22 super(CrosTabSwitchingMeasurement, self).__init__()
23 self._first_histogram = None
24
25 def CustomizeBrowserOptions(self, options):
26 """Adding necessary browser flag to collect histogram."""
27 options.AppendExtraBrowserArgs(['--enable-stats-collection-bindings'])
28
29 def DidNavigateToPage(self, page, tab):
30 """Record the starting histogram."""
31 self._first_histogram = cros_utils.GetTabSwitchHistogramRetry(tab.browser)
32
33 def ValidateAndMeasurePage(self, page, tab, results):
34 """Record the ending histogram for the tab switching metric."""
35 last_histogram = cros_utils.GetTabSwitchHistogramRetry(tab.browser)
36 total_diff_histogram = histogram_util.SubtractHistogram(
37 last_histogram, self._first_histogram)
38
39 display_name = 'MPArch_RWH_TabSwitchPaintDuration'
40 results.AddSummaryValue(
41 histogram.HistogramValue(
42 None, display_name, 'ms',
43 raw_value_json=total_diff_histogram,
44 important=False))
OLDNEW
« no previous file with comments | « tools/perf/contrib/cros_benchmarks/tab_switching_bench.py ('k') | tools/perf/contrib/cros_benchmarks/tab_switching_stories.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698