| 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 from core import perf_benchmark | 5 from core import perf_benchmark |
| 6 | 6 |
| 7 from telemetry import benchmark | 7 from telemetry import benchmark |
| 8 from telemetry.timeline import tracing_category_filter | 8 from telemetry.timeline import tracing_category_filter |
| 9 from telemetry.web_perf import timeline_based_measurement | 9 from telemetry.web_perf import timeline_based_measurement |
| 10 | 10 |
| 11 import page_sets | 11 import page_sets |
| 12 | 12 |
| 13 | 13 |
| 14 BLOB_CATEGORY = 'Blob' | 14 BLOB_CATEGORY = 'Blob' |
| 15 TIMELINE_REQUIRED_CATEGORY = 'blink.console' | 15 TIMELINE_REQUIRED_CATEGORY = 'blink.console' |
| 16 | 16 |
| 17 | 17 |
| 18 @benchmark.Disabled('reference', # http://crbug.com/496155 | 18 @benchmark.Disabled('reference', # http://crbug.com/496155 |
| 19 'xp', # http://crbug.com/545085 |
| 19 'android') # http://crbug.com/499325 | 20 'android') # http://crbug.com/499325 |
| 20 class BlobStorage(perf_benchmark.PerfBenchmark): | 21 class BlobStorage(perf_benchmark.PerfBenchmark): |
| 21 """Timeline based measurement benchmark for Blob Storage.""" | 22 """Timeline based measurement benchmark for Blob Storage.""" |
| 22 | 23 |
| 23 page_set = page_sets.BlobWorkshopPageSet | 24 page_set = page_sets.BlobWorkshopPageSet |
| 24 | 25 |
| 25 def CreateTimelineBasedMeasurementOptions(self): | 26 def CreateTimelineBasedMeasurementOptions(self): |
| 26 cat_filter = tracing_category_filter.CreateMinimalOverheadFilter() | 27 cat_filter = tracing_category_filter.CreateMinimalOverheadFilter() |
| 27 cat_filter.AddIncludedCategory(BLOB_CATEGORY) | 28 cat_filter.AddIncludedCategory(BLOB_CATEGORY) |
| 28 cat_filter.AddIncludedCategory(TIMELINE_REQUIRED_CATEGORY) | 29 cat_filter.AddIncludedCategory(TIMELINE_REQUIRED_CATEGORY) |
| 29 | 30 |
| 30 return timeline_based_measurement.Options( | 31 return timeline_based_measurement.Options( |
| 31 overhead_level=cat_filter) | 32 overhead_level=cat_filter) |
| 32 | 33 |
| 33 # Necessary until crbug.com/544306 is finished. | 34 # Necessary until crbug.com/544306 is finished. |
| 34 def SetExtraBrowserOptions(self, options): | 35 def SetExtraBrowserOptions(self, options): |
| 35 options.AppendExtraBrowserArgs( | 36 options.AppendExtraBrowserArgs( |
| 36 ['--enable-experimental-web-platform-features']) | 37 ['--enable-experimental-web-platform-features']) |
| 37 | 38 |
| 38 @classmethod | 39 @classmethod |
| 39 def Name(cls): | 40 def Name(cls): |
| 40 return 'blob_storage.blob_storage' | 41 return 'blob_storage.blob_storage' |
| 41 | 42 |
| 42 @classmethod | 43 @classmethod |
| 43 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 44 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 44 if ('blob-writes' not in value.name and | 45 if ('blob-writes' not in value.name and |
| 45 'blob-reads' not in value.name): | 46 'blob-reads' not in value.name): |
| 46 return False | 47 return False |
| 47 return value.values != None | 48 return value.values != None |
| OLD | NEW |