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 import page_sets | |
eakuefner
2015/11/18 18:39:53
this and the next line should be switched; these a
gabadie
2015/11/18 19:16:31
Done.
| |
6 from core import perf_benchmark | |
eakuefner
2015/11/18 18:39:52
newline between perf import section and third-part
gabadie
2015/11/18 19:16:31
Done.
| |
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 | |
12 | |
13 class _StartWithUrlTBM(perf_benchmark.PerfBenchmark): | |
eakuefner
2015/11/18 18:39:52
nit: newline after this line. the rule is, blank l
pasko
2015/11/18 18:56:46
it would be nice to have a docstring
gabadie
2015/11/18 19:16:31
Done.
| |
14 page_set = page_sets.StartupPagesPageSetTBM | |
15 | |
16 @classmethod | |
17 def Name(cls): | |
18 # TODO(gabadie): We don't want to replace start_with_url.* yet. | |
19 return 'start_with_url2.startup_pages' | |
20 | |
21 def SetExtraBrowserOptions(self, options): | |
22 options.AppendExtraBrowserArgs([ | |
23 '--enable-stats-collection-bindings' | |
24 ]) | |
25 | |
26 def CreateTimelineBasedMeasurementOptions(self): | |
27 startup_category_filter = tracing_category_filter.TracingCategoryFilter( | |
28 filter_string='startup,blink.user_timing') | |
29 options = timeline_based_measurement.Options( | |
30 overhead_level=startup_category_filter) | |
31 options.SetTimelineBasedMetrics( | |
32 [startup.StartupTimelineMetric()]) | |
33 return options | |
34 | |
35 | |
36 @benchmark.Enabled('has tabs') | |
37 @benchmark.Enabled('android') | |
38 @benchmark.Disabled('chromeos', 'linux', 'mac', 'win') | |
39 class StartWithUrlColdTBM(_StartWithUrlTBM): | |
40 """Measure time to start Chrome cold with startup URLs""" | |
eakuefner
2015/11/18 18:39:52
nit: newline after docstring
pasko
2015/11/18 18:56:46
nit: s/Measure/Measures/
(it's a class)
gabadie
2015/11/18 19:16:31
Done.
| |
41 options = {'pageset_repeat': 5} | |
42 | |
43 def SetExtraBrowserOptions(self, options): | |
44 options.clear_sytem_cache_for_browser_and_profile_on_start = True | |
45 super(StartWithUrlColdTBM, self).SetExtraBrowserOptions(options) | |
46 | |
47 @classmethod | |
48 def Name(cls): | |
49 return 'start_with_url2.cold.startup_pages' | |
50 | |
51 | |
52 @benchmark.Enabled('has tabs') | |
53 @benchmark.Enabled('android') | |
54 @benchmark.Disabled('chromeos', 'linux', 'mac', 'win') | |
55 class StartWithUrlWarmTBM(_StartWithUrlTBM): | |
56 """Measure time to start Chrome warm with startup URLs""" | |
eakuefner
2015/11/18 18:39:52
nit: newline after docstring.
gabadie
2015/11/18 19:16:31
Done.
| |
57 options = {'pageset_repeat': 10} | |
58 | |
59 @classmethod | |
60 def Name(cls): | |
61 return 'start_with_url2.warm.startup_pages' | |
OLD | NEW |