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

Unified Diff: tools/telemetry/telemetry/core/browser.py

Issue 19857003: [Telemetry] Add a profiler based loading measurement. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add tests Created 7 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 side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/core/browser.py
diff --git a/tools/telemetry/telemetry/core/browser.py b/tools/telemetry/telemetry/core/browser.py
index c604cae7885934c3174014e4d13c476ba578fa2a..c2a70374cc046ff612c82a835ef8879c387e86fd 100644
--- a/tools/telemetry/telemetry/core/browser.py
+++ b/tools/telemetry/telemetry/core/browser.py
@@ -192,26 +192,32 @@ class Browser(object):
del result['ProcessCount']
return result
- def StartProfiling(self, options, base_output_file):
- """Starts profiling using |options|.profiler_tool. Results are saved to
+ def StartProfiling(self, profiler_name, base_output_file):
+ """Starts profiling using |profiler_name|. Results are saved to
|base_output_file|.<process_name>."""
assert not self._active_profilers
- profiler_class = profiler_finder.FindProfiler(options.profiler)
+ profiler_class = profiler_finder.FindProfiler(profiler_name)
- if not profiler_class.is_supported(options):
+ if not profiler_class.is_supported(self._browser_backend.options):
raise Exception('The %s profiler is not '
- 'supported on this platform.' % options.profiler_tool)
+ 'supported on this platform.' % profiler_name)
self._active_profilers.append(
profiler_class(self._browser_backend, self._platform_backend,
base_output_file))
def StopProfiling(self):
- """Stops all active profilers and saves their results."""
+ """Stops all active profilers and saves their results.
+
+ Returns:
+ A list of filenames produced by the profiler.
+ """
+ output_files = []
for profiler in self._active_profilers:
- profiler.CollectProfile()
+ output_files.extend(profiler.CollectProfile())
self._active_profilers = []
+ return output_files
def StartTracing(self, custom_categories=None, timeout=10):
return self._browser_backend.StartTracing(custom_categories, timeout)
« no previous file with comments | « tools/perf/measurements/loading_profile.py ('k') | tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698