Chromium Code Reviews| 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( | |
|
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
| |
| 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': 10} | |
| 61 | |
| 62 @classmethod | |
| 63 def Name(cls): | |
| 64 return 'start_with_url2.warm.startup_pages' | |
| 65 | |
| 66 # TODO(gabadie): Uncomment this method and pageset_repeat++. This a current | |
| 67 # bug discovered in start_with_url where the results in the first page set | |
| 68 # iterations are actually cold because the profile was empty. However we | |
| 69 # don't want to fix right now because we want to make sure first that | |
| 70 # start_with_url2.* have same values as start_with_url.* before fixing this | |
| 71 # bug (pasko@chromium.org). | |
| 72 # @classmethod | |
| 73 # def ValueCanBeAddedPredicate(cls, _, is_first_result): | |
| 74 # # Ignores first results because the first invocation is actualy cold since | |
| 75 # # we are loading the profile for the first time. | |
| 76 # return not is_first_result | |
| OLD | NEW |