| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 | 4 |
| 5 import re | 5 import re |
| 6 | 6 |
| 7 from core import perf_benchmark | 7 from core import perf_benchmark |
| 8 from telemetry.timeline import chrome_trace_config | 8 from telemetry.timeline import chrome_trace_config |
| 9 from telemetry.timeline import chrome_trace_category_filter | 9 from telemetry.timeline import chrome_trace_category_filter |
| 10 from telemetry.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 chrome_trace_category_filter.ChromeTraceCategoryFilter( | 51 chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 52 ','.join(categories))) | 52 ','.join(categories))) |
| 53 options.config.enable_android_graphics_memtrack = True | 53 options.config.enable_android_graphics_memtrack = True |
| 54 # Trigger periodic light memory dumps every 1000 ms. | 54 # Trigger periodic light memory dumps every 1000 ms. |
| 55 memory_dump_config = chrome_trace_config.MemoryDumpConfig() | 55 memory_dump_config = chrome_trace_config.MemoryDumpConfig() |
| 56 memory_dump_config.AddTrigger('light', 1000) | 56 memory_dump_config.AddTrigger('light', 1000) |
| 57 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) | 57 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) |
| 58 options.SetTimelineBasedMetrics(['v8AndMemoryMetrics']) | 58 options.SetTimelineBasedMetrics(['v8AndMemoryMetrics']) |
| 59 return options | 59 return options |
| 60 | 60 |
| 61 def CreateStorySet(self, options): |
| 62 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, |
| 63 story_name_regex=r'browse:.*') |
| 64 |
| 61 @classmethod | 65 @classmethod |
| 62 def Name(cls): | 66 def Name(cls): |
| 63 return 'v8.browsing_%s' % cls.page_set.PLATFORM | 67 return 'v8.browsing_%s' % cls.PLATFORM |
| 64 | 68 |
| 65 @classmethod | 69 @classmethod |
| 66 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 70 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 67 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 71 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 68 # is able to cope with the data load generated by TBMv2 metrics. | 72 # is able to cope with the data load generated by TBMv2 metrics. |
| 69 if 'memory:chrome' in value.name: | 73 if 'memory:chrome' in value.name: |
| 70 return ('renderer_processes' in value.name and | 74 return ('renderer_processes' in value.name and |
| 71 not _IGNORED_MEMORY_STATS_RE.search(value.name)) | 75 not _IGNORED_MEMORY_STATS_RE.search(value.name)) |
| 72 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and | 76 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and |
| 73 not _IGNORED_V8_STATS_RE.search(value.name)) | 77 not _IGNORED_V8_STATS_RE.search(value.name)) |
| 74 | 78 |
| 75 @classmethod | 79 @classmethod |
| 76 def ShouldTearDownStateAfterEachStoryRun(cls): | 80 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 77 return True | 81 return True |
| 78 | 82 |
| 79 | 83 |
| 80 class V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): | 84 class V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): |
| 81 page_set = page_sets.DesktopBrowsingSystemHealthStorySet | 85 PLATFORM = 'desktop' |
| 82 | 86 |
| 83 @classmethod | 87 @classmethod |
| 84 def ShouldDisable(cls, possible_browser): | 88 def ShouldDisable(cls, possible_browser): |
| 85 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | 89 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' |
| 86 | 90 |
| 87 | 91 |
| 88 class V8MobileBrowsingBenchmark(_V8BrowsingBenchmark): | 92 class V8MobileBrowsingBenchmark(_V8BrowsingBenchmark): |
| 89 page_set = page_sets.MobileBrowsingSystemHealthStorySet | 93 PLATFORM = 'mobile' |
| 90 | 94 |
| 91 @classmethod | 95 @classmethod |
| 92 def ShouldDisable(cls, possible_browser): | 96 def ShouldDisable(cls, possible_browser): |
| 93 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' | 97 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' |
| OLD | NEW |