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..802f93230c48190a1a5ee424f31153097de178c0 |
--- /dev/null |
+++ b/tools/perf/contrib/cros_benchmarks/tab_switching_bench.py |
@@ -0,0 +1,44 @@ |
+# Copyright 2013 The Chromium Authors. All rights reserved. |
bccheng
2017/05/19 09:09:14
Change it to 2017?
vovoy
2017/05/22 03:54:08
Done.
|
+# 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.tab_switching_measure import TabSwitchingMeasurement |
deanliao_goog
2017/05/19 09:49:46
Import module, not class.
https://google.github.io
vovoy
2017/05/22 03:54:08
Done.
|
+from contrib.cros_benchmarks.tab_switching_stories import CrosMultiTabTypical24Story |
+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): |
+ """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. |
deanliao_goog
2017/05/19 09:49:46
Please rewrite the one-line description of the ben
vovoy
2017/05/22 03:54:08
Done.
|
+ |
+ The histogram is a measure of the time between when a tab was requested to be |
+ shown, and when first paint occurred. The script opens 24 pages in different |
+ tabs, waits for them to load, and then switches to each tab and records the |
+ metric. The pages were chosen from Alexa top ranking sites. |
+ """ |
+ test = TabSwitchingMeasurement |
+ |
+ @classmethod |
+ def AddBenchmarkCommandLineArgs(cls, parser): |
+ parser.add_option('--tabset-repeat', type='int', default=1, |
+ help='repeat tab page set') |
+ |
+ def CreateStorySet(self, options): |
+ 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(CrosMultiTabTypical24Story( |
+ story_set, options.tabset_repeat)) |
+ return story_set |
+ |
+ @classmethod |
+ def Name(cls): |
+ return 'cros_tab_switching.typical_24' |