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

Side by Side Diff: tools/perf/measurements/tab_switching.py

Issue 116043006: [Telemetry]: Assert that page measurement results don't contain a '.' in their name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 6 years, 11 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
« no previous file with comments | « no previous file | tools/perf/metrics/memory.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """The tab switching measurement. 5 """The tab switching measurement.
6 6
7 This measurement opens pages in different tabs. After all the tabs have opened, 7 This measurement opens pages in different tabs. After all the tabs have opened,
8 it cycles through each tab in sequence, and records a histogram of the time 8 it cycles through each tab in sequence, and records a histogram of the time
9 between when a tab was first requested to be shown, and when it was painted. 9 between when a tab was first requested to be shown, and when it was painted.
10 """ 10 """
(...skipping 30 matching lines...) Expand all
41 return 41 return
42 self._cpu_metric.Start(page, tab) 42 self._cpu_metric.Start(page, tab)
43 time.sleep(.5) 43 time.sleep(.5)
44 self._cpu_metric.Stop(page, tab) 44 self._cpu_metric.Stop(page, tab)
45 # Calculate the idle cpu load before any actions are done. 45 # Calculate the idle cpu load before any actions are done.
46 self._cpu_metric.AddResults(tab, results, 46 self._cpu_metric.AddResults(tab, results,
47 'idle_cpu_utilization') 47 'idle_cpu_utilization')
48 48
49 histogram_name = 'MPArch.RWH_TabSwitchPaintDuration' 49 histogram_name = 'MPArch.RWH_TabSwitchPaintDuration'
50 histogram_type = histogram_util.BROWSER_HISTOGRAM 50 histogram_type = histogram_util.BROWSER_HISTOGRAM
51 display_name = 'MPArch_RWH_TabSwitchPaintDuration'
51 first_histogram = histogram_util.GetHistogram( 52 first_histogram = histogram_util.GetHistogram(
52 histogram_type, histogram_name, tab) 53 histogram_type, histogram_name, tab)
53 prev_histogram = first_histogram 54 prev_histogram = first_histogram
54 55
55 for i in xrange(len(tab.browser.tabs)): 56 for i in xrange(len(tab.browser.tabs)):
56 t = tab.browser.tabs[i] 57 t = tab.browser.tabs[i]
57 t.Activate() 58 t.Activate()
58 def _IsDone(): 59 def _IsDone():
59 cur_histogram = histogram_util.GetHistogram( 60 cur_histogram = histogram_util.GetHistogram(
60 histogram_type, histogram_name, tab) 61 histogram_type, histogram_name, tab)
61 diff_histogram = histogram_util.SubtractHistogram( 62 diff_histogram = histogram_util.SubtractHistogram(
62 cur_histogram, prev_histogram) 63 cur_histogram, prev_histogram)
63 return diff_histogram 64 return diff_histogram
64 util.WaitFor(_IsDone, 30) 65 util.WaitFor(_IsDone, 30)
65 prev_histogram = histogram_util.GetHistogram( 66 prev_histogram = histogram_util.GetHistogram(
66 histogram_type, histogram_name, tab) 67 histogram_type, histogram_name, tab)
67 68
68 last_histogram = histogram_util.GetHistogram( 69 last_histogram = histogram_util.GetHistogram(
69 histogram_type, histogram_name, tab) 70 histogram_type, histogram_name, tab)
70 diff_histogram = histogram_util.SubtractHistogram(last_histogram, 71 diff_histogram = histogram_util.SubtractHistogram(last_histogram,
71 first_histogram) 72 first_histogram)
72 73
73 results.AddSummary(histogram_name, '', diff_histogram, 74 results.AddSummary(display_name, '', diff_histogram,
74 data_type='unimportant-histogram') 75 data_type='unimportant-histogram')
OLDNEW
« no previous file with comments | « no previous file | tools/perf/metrics/memory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698