OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2015 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 from core import perf_benchmark | |
6 import page_sets | |
7 | |
8 from telemetry import benchmark | |
9 from telemetry.timeline import tracing_category_filter | |
10 from telemetry.web_perf import timeline_based_measurement | |
11 from telemetry.web_perf.metrics import startup | |
12 | |
13 | |
14 class _StartWithUrlTBM(perf_benchmark.PerfBenchmark): | |
15 """Measures time to start Chrome with startup URLs""" | |
pasko
2015/11/19 13:08:17
nit: period, same below
gabadie
2015/11/19 16:25:25
Done.
| |
16 | |
17 page_set = page_sets.StartupPagesPageSetTBM | |
18 | |
19 @classmethod | |
20 def Name(cls): | |
21 # TODO(gabadie): We don't want to replace start_with_url.* yet. | |
pasko
2015/11/19 13:08:17
please avoid 'We'. You could say:
TODO(gabadie):
gabadie
2015/11/19 16:25:25
Done.
| |
22 return 'start_with_url2.startup_pages' | |
23 | |
24 def SetExtraBrowserOptions(self, options): | |
25 options.AppendExtraBrowserArgs([ | |
26 '--enable-stats-collection-bindings' | |
27 ]) | |
28 | |
29 def CreateTimelineBasedMeasurementOptions(self): | |
30 startup_category_filter = tracing_category_filter.TracingCategoryFilter( | |
31 filter_string='startup,blink.user_timing') | |
32 options = timeline_based_measurement.Options( | |
33 overhead_level=startup_category_filter) | |
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 """Measures time to start Chrome cold with startup URLs""" | |
44 | |
45 options = {'pageset_repeat': 5} | |
46 | |
47 def SetExtraBrowserOptions(self, options): | |
48 options.clear_sytem_cache_for_browser_and_profile_on_start = True | |
49 super(StartWithUrlColdTBM, self).SetExtraBrowserOptions(options) | |
50 | |
51 @classmethod | |
52 def Name(cls): | |
53 return 'start_with_url2.cold.startup_pages' | |
54 | |
55 | |
56 @benchmark.Enabled('has tabs') | |
57 @benchmark.Enabled('android') | |
58 @benchmark.Disabled('chromeos', 'linux', 'mac', 'win') | |
59 class StartWithUrlWarmTBM(_StartWithUrlTBM): | |
60 """Measures stimetime to start Chrome warm with startup URLs""" | |
61 | |
62 options = {'pageset_repeat': 10} | |
pasko
2015/11/19 13:08:17
Why 10 for warm and 5 for cold? Is this based on s
nednguyen
2015/11/19 15:56:46
For now, let's make these number the same as legac
pasko
2015/11/20 13:35:49
Acknowledged.
| |
63 | |
64 @classmethod | |
65 def Name(cls): | |
66 return 'start_with_url2.warm.startup_pages' | |
OLD | NEW |