| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 import os | 4 import os |
| 5 | 5 |
| 6 from core import path_util | 6 from core import path_util |
| 7 from core import perf_benchmark | 7 from core import perf_benchmark |
| 8 from page_sets import google_pages | 8 from page_sets import google_pages |
| 9 | 9 |
| 10 from benchmarks import v8_helper | 10 from benchmarks import v8_helper |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 return True | 222 return True |
| 223 # http://crbug.com/623576 | 223 # http://crbug.com/623576 |
| 224 if (possible_browser.platform.GetDeviceTypeName() == 'Nexus 5' or | 224 if (possible_browser.platform.GetDeviceTypeName() == 'Nexus 5' or |
| 225 possible_browser.platform.GetDeviceTypeName() == 'Nexus 7'): | 225 possible_browser.platform.GetDeviceTypeName() == 'Nexus 7'): |
| 226 return True | 226 return True |
| 227 return False | 227 return False |
| 228 | 228 |
| 229 @classmethod | 229 @classmethod |
| 230 def ShouldTearDownStateAfterEachStoryRun(cls): | 230 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 231 return True | 231 return True |
| 232 |
| 233 |
| 234 class _Top25RuntimeStats(perf_benchmark.PerfBenchmark): |
| 235 options = {'pageset_repeat': 1} |
| 236 |
| 237 def CreateTimelineBasedMeasurementOptions(self): |
| 238 # TODO(fmeawad): most of the cat_filter information is extracted from |
| 239 # page_cycler_v2 TimelineBasedMeasurementOptionsForLoadingMetric because |
| 240 # used by the loadingMetric because the runtimeStatsMetric uses the |
| 241 # interactive time calculated internally by the loadingMetric. |
| 242 # It is better to share the code so that we can keep them in sync. |
| 243 cat_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() |
| 244 |
| 245 # "blink.console" is used for marking ranges in |
| 246 # cache_temperature.MarkTelemetryInternal. |
| 247 cat_filter.AddIncludedCategory('blink.console') |
| 248 |
| 249 # "navigation" and "blink.user_timing" are needed to capture core |
| 250 # navigation events. |
| 251 cat_filter.AddIncludedCategory('navigation') |
| 252 cat_filter.AddIncludedCategory('blink.user_timing') |
| 253 |
| 254 # "loading" is needed for first-meaningful-paint computation. |
| 255 cat_filter.AddIncludedCategory('loading') |
| 256 |
| 257 # "toplevel" category is used to capture TaskQueueManager events |
| 258 # necessary to compute time-to-interactive. |
| 259 cat_filter.AddIncludedCategory('toplevel') |
| 260 |
| 261 # V8 needed categories |
| 262 cat_filter.AddIncludedCategory('v8') |
| 263 cat_filter.AddDisabledByDefault('disabled-by-default-v8.runtime_stats') |
| 264 |
| 265 tbm_options = timeline_based_measurement.Options( |
| 266 overhead_level=cat_filter) |
| 267 tbm_options.SetTimelineBasedMetrics(['runtimeStatsMetric']) |
| 268 return tbm_options |
| 269 |
| 270 @classmethod |
| 271 def ShouldDisable(cls, possible_browser): |
| 272 if possible_browser.browser_type == 'reference': |
| 273 return True |
| 274 return False |
| 275 |
| 276 |
| 277 @benchmark.Disabled('android', 'win', 'reference') # crbug.com/664318 |
| 278 class V8Top25RuntimeStats(_Top25RuntimeStats): |
| 279 """Runtime Stats benchmark for a 25 top V8 web pages. |
| 280 |
| 281 Designed to represent a mix between top websites and a set of pages that |
| 282 have unique V8 characteristics. |
| 283 """ |
| 284 |
| 285 @classmethod |
| 286 def Name(cls): |
| 287 return 'v8.runtime_stats.top_25' |
| 288 |
| 289 def CreateStorySet(self, options): |
| 290 return page_sets.V8Top25StorySet() |
| OLD | NEW |