Index: tools/perf/benchmarks/start_with_url2.py |
diff --git a/tools/perf/benchmarks/start_with_url2.py b/tools/perf/benchmarks/start_with_url2.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2a62f4effc56716807a458aac07a0a24521e7612 |
--- /dev/null |
+++ b/tools/perf/benchmarks/start_with_url2.py |
@@ -0,0 +1,61 @@ |
+# Copyright 2015 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import page_sets |
eakuefner
2015/11/18 18:39:53
this and the next line should be switched; these a
gabadie
2015/11/18 19:16:31
Done.
|
+from core import perf_benchmark |
eakuefner
2015/11/18 18:39:52
newline between perf import section and third-part
gabadie
2015/11/18 19:16:31
Done.
|
+from telemetry import benchmark |
+from telemetry.timeline import tracing_category_filter |
+from telemetry.web_perf import timeline_based_measurement |
+from telemetry.web_perf.metrics import startup |
+ |
+ |
+class _StartWithUrlTBM(perf_benchmark.PerfBenchmark): |
eakuefner
2015/11/18 18:39:52
nit: newline after this line. the rule is, blank l
pasko
2015/11/18 18:56:46
it would be nice to have a docstring
gabadie
2015/11/18 19:16:31
Done.
|
+ page_set = page_sets.StartupPagesPageSetTBM |
+ |
+ @classmethod |
+ def Name(cls): |
+ # TODO(gabadie): We don't want to replace start_with_url.* yet. |
+ return 'start_with_url2.startup_pages' |
+ |
+ def SetExtraBrowserOptions(self, options): |
+ options.AppendExtraBrowserArgs([ |
+ '--enable-stats-collection-bindings' |
+ ]) |
+ |
+ def CreateTimelineBasedMeasurementOptions(self): |
+ startup_category_filter = tracing_category_filter.TracingCategoryFilter( |
+ filter_string='startup,blink.user_timing') |
+ options = timeline_based_measurement.Options( |
+ overhead_level=startup_category_filter) |
+ options.SetTimelineBasedMetrics( |
+ [startup.StartupTimelineMetric()]) |
+ return options |
+ |
+ |
+@benchmark.Enabled('has tabs') |
+@benchmark.Enabled('android') |
+@benchmark.Disabled('chromeos', 'linux', 'mac', 'win') |
+class StartWithUrlColdTBM(_StartWithUrlTBM): |
+ """Measure time to start Chrome cold with startup URLs""" |
eakuefner
2015/11/18 18:39:52
nit: newline after docstring
pasko
2015/11/18 18:56:46
nit: s/Measure/Measures/
(it's a class)
gabadie
2015/11/18 19:16:31
Done.
|
+ options = {'pageset_repeat': 5} |
+ |
+ def SetExtraBrowserOptions(self, options): |
+ options.clear_sytem_cache_for_browser_and_profile_on_start = True |
+ super(StartWithUrlColdTBM, self).SetExtraBrowserOptions(options) |
+ |
+ @classmethod |
+ def Name(cls): |
+ return 'start_with_url2.cold.startup_pages' |
+ |
+ |
+@benchmark.Enabled('has tabs') |
+@benchmark.Enabled('android') |
+@benchmark.Disabled('chromeos', 'linux', 'mac', 'win') |
+class StartWithUrlWarmTBM(_StartWithUrlTBM): |
+ """Measure time to start Chrome warm with startup URLs""" |
eakuefner
2015/11/18 18:39:52
nit: newline after docstring.
gabadie
2015/11/18 19:16:31
Done.
|
+ options = {'pageset_repeat': 10} |
+ |
+ @classmethod |
+ def Name(cls): |
+ return 'start_with_url2.warm.startup_pages' |