| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 | 8 |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 from telemetry.timeline import tracing_category_filter | 10 from telemetry.timeline import tracing_category_filter |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 @classmethod | 155 @classmethod |
| 156 def Name(cls): | 156 def Name(cls): |
| 157 return 'memory.blink_memory_mobile' | 157 return 'memory.blink_memory_mobile' |
| 158 | 158 |
| 159 @classmethod | 159 @classmethod |
| 160 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 160 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 161 return bool(cls._RE_RENDERER_VALUES.match(value.name)) | 161 return bool(cls._RE_RENDERER_VALUES.match(value.name)) |
| 162 | 162 |
| 163 | 163 |
| 164 class _MemoryV8Benchmark(_MemoryInfra): | 164 class _MemoryV8Benchmark(_MemoryInfra): |
| 165 |
| 166 # Report only V8-specific and overall renderer memory values. Note that |
| 167 # detailed values reported by the OS (such as native heap) are excluded. |
| 168 _V8_AND_OVERALL_MEMORY_RE = re.compile( |
| 169 r'renderer:(reported_by_chrome:v8|reported_by_os:system:[^:]+$)') |
| 170 |
| 165 def CreateTimelineBasedMeasurementOptions(self): | 171 def CreateTimelineBasedMeasurementOptions(self): |
| 166 v8_categories = [ | 172 v8_categories = [ |
| 167 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] | 173 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] |
| 168 memory_categories = ['blink.console', 'disabled-by-default-memory-infra'] | 174 memory_categories = ['blink.console', 'disabled-by-default-memory-infra'] |
| 169 category_filter = tracing_category_filter.TracingCategoryFilter( | 175 category_filter = tracing_category_filter.TracingCategoryFilter( |
| 170 ','.join(['-*'] + v8_categories + memory_categories)) | 176 ','.join(['-*'] + v8_categories + memory_categories)) |
| 171 options = timeline_based_measurement.Options(category_filter) | 177 options = timeline_based_measurement.Options(category_filter) |
| 172 options.SetTimelineBasedMetric('v8AndMemoryMetrics') | 178 options.SetTimelineBasedMetric('v8AndMemoryMetrics') |
| 173 return options | 179 return options |
| 174 | 180 |
| 175 @classmethod | 181 @classmethod |
| 176 def ValueCanBeAddedPredicate(cls, value, _): | 182 def ValueCanBeAddedPredicate(cls, value, _): |
| 177 if 'memory:chrome' in value.name: | 183 if 'memory:chrome' in value.name: |
| 184 # TODO(petrcermak): Remove the first two cases once |
| 185 # https://codereview.chromium.org/2018503002/ lands in Catapult and rolls |
| 186 # into Chromium. |
| 178 return ('renderer:subsystem:v8' in value.name or | 187 return ('renderer:subsystem:v8' in value.name or |
| 179 'renderer:vmstats:overall' in value.name) | 188 'renderer:vmstats:overall' in value.name or |
| 189 bool(cls._V8_AND_OVERALL_MEMORY_RE.search(value.name))) |
| 180 return 'v8' in value.name | 190 return 'v8' in value.name |
| 181 | 191 |
| 182 | 192 |
| 183 class MemoryLongRunningIdleGmail(_MemoryV8Benchmark): | 193 class MemoryLongRunningIdleGmail(_MemoryV8Benchmark): |
| 184 """Use (recorded) real world web sites and measure memory consumption | 194 """Use (recorded) real world web sites and measure memory consumption |
| 185 of long running idle Gmail page """ | 195 of long running idle Gmail page """ |
| 186 page_set = page_sets.LongRunningIdleGmailPageSet | 196 page_set = page_sets.LongRunningIdleGmailPageSet |
| 187 | 197 |
| 188 @classmethod | 198 @classmethod |
| 189 def Name(cls): | 199 def Name(cls): |
| (...skipping 10 matching lines...) Expand all Loading... |
| 200 of long running idle Gmail page """ | 210 of long running idle Gmail page """ |
| 201 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | 211 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet |
| 202 | 212 |
| 203 @classmethod | 213 @classmethod |
| 204 def Name(cls): | 214 def Name(cls): |
| 205 return 'memory.long_running_idle_gmail_background_tbmv2' | 215 return 'memory.long_running_idle_gmail_background_tbmv2' |
| 206 | 216 |
| 207 @classmethod | 217 @classmethod |
| 208 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 | 218 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 |
| 209 return cls.IsSvelte(possible_browser) | 219 return cls.IsSvelte(possible_browser) |
| OLD | NEW |