| 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, case='browse') |
| 63 |
| 61 @classmethod | 64 @classmethod |
| 62 def Name(cls): | 65 def Name(cls): |
| 63 return 'v8.browsing_%s' % cls.page_set.PLATFORM | 66 return 'v8.browsing_%s' % cls.PLATFORM |
| 64 | 67 |
| 65 @classmethod | 68 @classmethod |
| 66 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 69 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 67 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 70 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| 68 # is able to cope with the data load generated by TBMv2 metrics. | 71 # is able to cope with the data load generated by TBMv2 metrics. |
| 69 if 'memory:chrome' in value.name: | 72 if 'memory:chrome' in value.name: |
| 70 return ('renderer_processes' in value.name and | 73 return ('renderer_processes' in value.name and |
| 71 not _IGNORED_MEMORY_STATS_RE.search(value.name)) | 74 not _IGNORED_MEMORY_STATS_RE.search(value.name)) |
| 72 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and | 75 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and |
| 73 not _IGNORED_V8_STATS_RE.search(value.name)) | 76 not _IGNORED_V8_STATS_RE.search(value.name)) |
| 74 | 77 |
| 75 @classmethod | 78 @classmethod |
| 76 def ShouldTearDownStateAfterEachStoryRun(cls): | 79 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 77 return True | 80 return True |
| 78 | 81 |
| 79 | 82 |
| 80 class V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): | 83 class V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): |
| 81 page_set = page_sets.DesktopBrowsingSystemHealthStorySet | 84 PLATFORM = 'desktop' |
| 82 | 85 |
| 83 @classmethod | 86 @classmethod |
| 84 def ShouldDisable(cls, possible_browser): | 87 def ShouldDisable(cls, possible_browser): |
| 85 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | 88 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' |
| 86 | 89 |
| 87 | 90 |
| 88 class V8MobileBrowsingBenchmark(_V8BrowsingBenchmark): | 91 class V8MobileBrowsingBenchmark(_V8BrowsingBenchmark): |
| 89 page_set = page_sets.MobileBrowsingSystemHealthStorySet | 92 PLATFORM = 'mobile' |
| 90 | 93 |
| 91 @classmethod | 94 @classmethod |
| 92 def ShouldDisable(cls, possible_browser): | 95 def ShouldDisable(cls, possible_browser): |
| 93 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' | 96 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' |
| OLD | NEW |