Chromium Code Reviews| 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..5caaec9ca842754b6066811a1141b91e740ea66f |
| --- /dev/null |
| +++ b/tools/perf/benchmarks/start_with_url2.py |
| @@ -0,0 +1,76 @@ |
| +# 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( |
|
Zhen Wang
2015/11/13 00:21:27
How did you enable memory-infra? Where is blink.co
gabadie
2015/11/13 12:16:00
Oups indeed. Bad naming. It has absolutly nothing
|
| + 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': 10} |
| + |
| + @classmethod |
| + def Name(cls): |
| + return 'start_with_url2.warm.startup_pages' |
| + |
| + # TODO(gabadie): Uncomment this method and pageset_repeat++. This a current |
| + # bug discovered in start_with_url where the results in the first page set |
| + # iterations are actually cold because the profile was empty. However we |
| + # don't want to fix right now because we want to make sure first that |
| + # start_with_url2.* have same values as start_with_url.* before fixing this |
| + # bug (pasko@chromium.org). |
| + # @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 |