def CreateTimelineBasedMeasurementOptions(self): v8_gc_latency_categories = [ 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] smoothness_categories = [ 'webkit.console', 'blink.console', 'benchmark', 'trace_event_overhead'] categories = list(set(v8_gc_latency_categories + smoothness_categories)) memory_categories = 'blink.console,disabled-by-default-memory-infra' category_filter = tracing_category_filter.TracingCategoryFilter( memory_categories) for category in categories: category_filter.AddIncludedCategory(category) options = timeline_based_measurement.Options(category_filter) options.SetTimelineBasedMetrics([v8_gc_latency.V8GCLatency(), smoothness.SmoothnessMetric(), memory_timeline.MemoryTimelineMetric()]) return options
def MeasureFakePage(self): # Create a fake page and add it to the page set. results = page_test_results.PageTestResults() page = V8GCLatencyTestPageHelper.MockV8GCLatencyPage(self._page_set) self._page_set.AddStory(page) # Pretend we're about to run the tests to silence lower level asserts. results.WillRunPage(page) metric = v8_gc_latency.V8GCLatency() # Finalize the timeline import. self._model.FinalizeImport() for interaction in self._interaction_records: # Measure the V8GCLatency metric and return the results # pylint: disable=protected-access metric._AddV8MetricsToResults(self._model, [interaction], results) results.DidRunPage(page) return results
def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): tbm_options.SetLegacyTimelineBasedMetrics(( v8_gc_latency.V8GCLatency(), memory_timeline.MemoryTimelineMetric(), ))