Chromium Code Reviews| Index: tools/perf/contrib/cros_benchmarks/tab_switching_bench.py |
| diff --git a/tools/perf/contrib/cros_benchmarks/tab_switching_bench.py b/tools/perf/contrib/cros_benchmarks/tab_switching_bench.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1f1d8cfbd857e23b21e34ecd08963df31236106c |
| --- /dev/null |
| +++ b/tools/perf/contrib/cros_benchmarks/tab_switching_bench.py |
| @@ -0,0 +1,52 @@ |
| +# Copyright 2017 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 os |
| + |
| +from core import perf_benchmark |
| + |
| +from contrib.cros_benchmarks import tab_switching_measure |
| +from contrib.cros_benchmarks import tab_switching_stories |
| +from telemetry import benchmark |
| +from telemetry import story |
| + |
| + |
| +@benchmark.Owner(emails=['vovoy@chromium.org'], |
| + component='OS>Performance') |
| +@benchmark.Enabled('chromeos') |
| +class CrosTabSwitchingTypical24(perf_benchmark.PerfBenchmark): |
| + """Measuring the tab switching performance when there are many tabs. |
|
deanliao_goog
2017/05/23 08:54:26
Measures tab switching performance with 24 tabs.
vovoy
2017/05/24 09:17:22
Done.
|
| + |
| + The script opens 24 pages in 24 different tabs, waits for them to load, |
| + and then switches to each tabs and measures the tabs paint time. The 24 |
| + pages were chosen from Alexa top ranking sites. Tab paint time is the |
| + time between when a tab was requested to be shwon, and when first paint |
|
deanliao_goog
2017/05/23 08:54:26
time between tab being requested and the first pai
vovoy
2017/05/24 09:17:22
Done.
|
| + occurred. |
| + |
| + --tabset-repeat=N: Multiply the tab count by N to open more tabs. |
|
deanliao_goog
2017/05/23 08:54:26
How about this:
Benchmark specific option:
--ta
vovoy
2017/05/24 09:17:21
Done.
|
| + The following usage example opens 120 tabs. |
| + $ ./run_benchmark --browser=cros-chrome --remote=DUT_IP |
| + cros_tab_switching.typical_24 --tabset-repeat=5 |
| + """ |
| + test = tab_switching_measure.CrosTabSwitchingMeasurement |
| + |
| + @classmethod |
| + def AddBenchmarkCommandLineArgs(cls, parser): |
| + parser.add_option('--tabset-repeat', type='int', default=1, |
| + help='repeat tab page set') |
| + |
| + def CreateStorySet(self, options): |
| + if not options.cros_remote: |
| + raise ValueError('Must specify --remote=DUT_IP to run this test.') |
| + story_set = story.StorySet( |
| + archive_data_file='data/tab_switching.json', |
| + base_dir=os.path.dirname(os.path.abspath(__file__)), |
| + cloud_storage_bucket=story.PARTNER_BUCKET) |
| + story_set.AddStory(tab_switching_stories.CrosMultiTabTypical24Story( |
| + story_set, options.cros_remote, options.tabset_repeat)) |
| + return story_set |
| + |
| + @classmethod |
| + def Name(cls): |
| + return 'cros_tab_switching.typical_24' |