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

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

Issue 23458037: Profiler.is_supported takes browser_type instead of options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix loading_profile.py Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/browser.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 import util 9 from telemetry.core import util
10 from telemetry.core.platform.profiler import perf_profiler 10 from telemetry.core.platform.profiler import perf_profiler
11 from telemetry.page import page_measurement 11 from telemetry.page import page_measurement
12 12
13 class LoadingProfile(page_measurement.PageMeasurement): 13 class LoadingProfile(page_measurement.PageMeasurement):
14 def __init__(self): 14 def __init__(self):
15 super(LoadingProfile, self).__init__(discard_first_result=True) 15 super(LoadingProfile, self).__init__(discard_first_result=True)
16 16
17 if not perf_profiler.PerfProfiler.is_supported(None): 17 if not perf_profiler.PerfProfiler.is_supported(browser_type='any'):
18 raise Exception('This measurement is not supported on this platform') 18 raise Exception('This measurement is not supported on this platform')
19 19
20 @property 20 @property
21 def results_are_the_same_on_every_page(self): 21 def results_are_the_same_on_every_page(self):
22 return False 22 return False
23 23
24 def AddCommandLineOptions(self, parser): 24 def AddCommandLineOptions(self, parser):
25 # In order to change the default of an option, we must remove and re-add it. 25 # In order to change the default of an option, we must remove and re-add it.
26 page_repeat_option = parser.get_option('--page-repeat') 26 page_repeat_option = parser.get_option('--page-repeat')
27 page_repeat_option.default = 2 27 page_repeat_option.default = 2
(...skipping 20 matching lines...) Expand all
48 loading.LoadingMetric().AddResults(tab, results) 48 loading.LoadingMetric().AddResults(tab, results)
49 49
50 profile_file = None 50 profile_file = None
51 for profile_file in profile_files: 51 for profile_file in profile_files:
52 if 'renderer' in profile_file: 52 if 'renderer' in profile_file:
53 break 53 break
54 54
55 for function, period in perf_profiler.PerfProfiler.GetTopSamples( 55 for function, period in perf_profiler.PerfProfiler.GetTopSamples(
56 tab.browser.platform.GetOSName(), profile_file, 10).iteritems(): 56 tab.browser.platform.GetOSName(), profile_file, 10).iteritems():
57 results.Add(function.replace('.', '_'), 'period', period) 57 results.Add(function.replace('.', '_'), 'period', period)
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/browser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698