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..9e66714d57de47ba78e5630ab18f41cddf592d25 |
| --- /dev/null |
| +++ b/tools/perf/benchmarks/start_with_url2.py |
| @@ -0,0 +1,75 @@ |
| +# 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) |
|
eakuefner
2015/11/17 16:51:52
You probably don't need this since you're not coll
gabadie
2015/11/17 18:14:23
Done.
|
| + |
| + 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""" |
| + 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 |
|
eakuefner
2015/11/17 16:51:52
Please don't leave commented code in your CL like
gabadie
2015/11/17 18:14:23
Done. Created crbug.com/557242.
|
| + # 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 |