OLD | NEW |
(Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import page_sets |
| 6 from core import perf_benchmark |
| 7 from telemetry import benchmark |
| 8 from telemetry.timeline import tracing_category_filter |
| 9 from telemetry.web_perf import timeline_based_measurement |
| 10 from telemetry.web_perf.metrics import startup |
| 11 from metrics import keychain_metric |
| 12 |
| 13 |
| 14 class _StartWithUrlTBM(perf_benchmark.PerfBenchmark): |
| 15 page_set = page_sets.StartupPagesPageSetTBM |
| 16 |
| 17 @classmethod |
| 18 def Name(cls): |
| 19 # TODO(gabadie): We don't want to replace start_with_url.* yet. |
| 20 return 'start_with_url2.startup_pages' |
| 21 |
| 22 def SetExtraBrowserOptions(self, options): |
| 23 options.AppendExtraBrowserArgs([ |
| 24 '--enable-stats-collection-bindings' |
| 25 ]) |
| 26 keychain_metric.KeychainMetric.CustomizeBrowserOptions(options) |
| 27 |
| 28 def CreateTimelineBasedMeasurementOptions(self): |
| 29 # Enable only memory-infra, to get memory dumps, and blink.console, to get |
| 30 # the timeline markers used for mapping threads to tabs. |
| 31 trace_memory = tracing_category_filter.TracingCategoryFilter( |
| 32 filter_string='startup,blink.user_timing') |
| 33 options = timeline_based_measurement.Options(overhead_level=trace_memory) |
| 34 options.SetTimelineBasedMetrics( |
| 35 [startup.StartupTimelineMetric()]) |
| 36 return options |
| 37 |
| 38 |
| 39 @benchmark.Enabled('has tabs') |
| 40 @benchmark.Enabled('android') |
| 41 @benchmark.Disabled('chromeos', 'linux', 'mac', 'win') |
| 42 class StartWithUrlColdTBM(_StartWithUrlTBM): |
| 43 """Measure time to start Chrome cold with startup URLs""" |
| 44 options = {'pageset_repeat': 5} |
| 45 |
| 46 def SetExtraBrowserOptions(self, options): |
| 47 options.clear_sytem_cache_for_browser_and_profile_on_start = True |
| 48 super(StartWithUrlColdTBM, self).SetExtraBrowserOptions(options) |
| 49 |
| 50 @classmethod |
| 51 def Name(cls): |
| 52 return 'start_with_url2.cold.startup_pages' |
| 53 |
| 54 |
| 55 @benchmark.Enabled('has tabs') |
| 56 @benchmark.Enabled('android') |
| 57 @benchmark.Disabled('chromeos', 'linux', 'mac', 'win') |
| 58 class StartWithUrlWarmTBM(_StartWithUrlTBM): |
| 59 """Measure time to start Chrome warm with startup URLs""" |
| 60 options = {'pageset_repeat': 11} |
| 61 |
| 62 @classmethod |
| 63 def Name(cls): |
| 64 return 'start_with_url2.warm.startup_pages' |
| 65 |
| 66 @classmethod |
| 67 def ValueCanBeAddedPredicate(cls, _, is_first_result): |
| 68 # Ignores first results because the first invocation is actualy cold since |
| 69 # we are loading the profile for the first time. |
| 70 return not is_first_result |
OLD | NEW |