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..8b30257b1b67ea11c989cc2815e99b8c8410a48c |
--- /dev/null |
+++ b/tools/perf/benchmarks/start_with_url2.py |
@@ -0,0 +1,70 @@ |
+# Copyright 2014 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 |
+from core import perf_benchmark |
+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 |
+from metrics import keychain_metric |
+ |
+ |
+class _StartWithUrlTBM(perf_benchmark.PerfBenchmark): |
+ 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' |
+ ]) |
+ keychain_metric.KeychainMetric.CustomizeBrowserOptions(options) |
+ |
+ def CreateTimelineBasedMeasurementOptions(self): |
+ # Enable only memory-infra, to get memory dumps, and blink.console, to get |
+ # the timeline markers used for mapping threads to tabs. |
+ trace_memory = tracing_category_filter.TracingCategoryFilter( |
+ filter_string='startup,blink.user_timing') |
+ options = timeline_based_measurement.Options(overhead_level=trace_memory) |
+ 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""" |
+ 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""" |
+ options = {'pageset_repeat': 11} |
+ |
+ @classmethod |
+ def Name(cls): |
+ return 'start_with_url2.warm.startup_pages' |
+ |
+ @classmethod |
+ def ValueCanBeAddedPredicate(cls, _, is_first_result): |
+ # Ignores first results because the first invocation is actualy cold since |
+ # we are loading the profile for the first time. |
+ return not is_first_result |