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

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

Issue 394953002: {Csv,Block}PageMeasurementResults no longer perform streaming output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again (!!) Created 6 years, 5 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 | « tools/perf/benchmarks/dom_perf.py ('k') | tools/perf/measurements/loading_trace.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 import os 5 import os
6 import tempfile 6 import tempfile
7 7
8 from metrics import loading 8 from metrics import loading
9 from telemetry.core.platform.profiler import perf_profiler 9 from telemetry.core.platform.profiler import perf_profiler
10 from telemetry.page import page_measurement 10 from telemetry.page import page_measurement
11 from telemetry.value import scalar 11 from telemetry.value import scalar
12 12
13 13
14 class LoadingProfile(page_measurement.PageMeasurement): 14 class LoadingProfile(page_measurement.PageMeasurement):
15 options = {'page_repeat': 2} 15 options = {'page_repeat': 2}
16 16
17 def __init__(self): 17 def __init__(self):
18 super(LoadingProfile, self).__init__(discard_first_result=True) 18 super(LoadingProfile, self).__init__(discard_first_result=True)
19 19
20 @property
21 def results_are_the_same_on_every_page(self):
22 return False
23
24 def CustomizeBrowserOptions(self, options): 20 def CustomizeBrowserOptions(self, options):
25 if not perf_profiler.PerfProfiler.is_supported(browser_type='any'): 21 if not perf_profiler.PerfProfiler.is_supported(browser_type='any'):
26 raise Exception('This measurement is not supported on this platform') 22 raise Exception('This measurement is not supported on this platform')
27 23
28 perf_profiler.PerfProfiler.CustomizeBrowserOptions( 24 perf_profiler.PerfProfiler.CustomizeBrowserOptions(
29 browser_type='any', options=options) 25 browser_type='any', options=options)
30 26
31 def WillNavigateToPage(self, page, tab): 27 def WillNavigateToPage(self, page, tab):
32 tab.browser.StartProfiling(perf_profiler.PerfProfiler.name(), 28 tab.browser.StartProfiling(perf_profiler.PerfProfiler.name(),
33 os.path.join(tempfile.mkdtemp(), 29 os.path.join(tempfile.mkdtemp(),
(...skipping 10 matching lines...) Expand all
44 40
45 profile_file = None 41 profile_file = None
46 for profile_file in profile_files: 42 for profile_file in profile_files:
47 if 'renderer' in profile_file: 43 if 'renderer' in profile_file:
48 break 44 break
49 45
50 for function, period in perf_profiler.PerfProfiler.GetTopSamples( 46 for function, period in perf_profiler.PerfProfiler.GetTopSamples(
51 profile_file, 10).iteritems(): 47 profile_file, 10).iteritems():
52 results.AddValue(scalar.ScalarValue( 48 results.AddValue(scalar.ScalarValue(
53 results.current_page, function.replace('.', '_'), 'period', period)) 49 results.current_page, function.replace('.', '_'), 'period', period))
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/dom_perf.py ('k') | tools/perf/measurements/loading_trace.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698