| Index: tools/perf/measurements/draw_properties.py
|
| diff --git a/tools/perf/measurements/draw_properties.py b/tools/perf/measurements/draw_properties.py
|
| index 3021930188375570f71fa391bba76cfcd91b9394..9f9a763eb623349e341d41bd3538d78fc8c13d66 100644
|
| --- a/tools/perf/measurements/draw_properties.py
|
| +++ b/tools/perf/measurements/draw_properties.py
|
| @@ -21,11 +21,18 @@ class DrawProperties(legacy_page_test.LegacyPageTest):
|
| def WillNavigateToPage(self, page, tab):
|
| del page # unused
|
| config = tracing_config.TracingConfig()
|
| - config.chrome_trace_config.category_filter.AddDisabledByDefault(
|
| - 'disabled-by-default-cc.debug.cdp-perf')
|
| + config.chrome_trace_config.category_filter.AddIncludedCategory('cc')
|
| config.enable_chrome_trace = True
|
| tab.browser.platform.tracing_controller.StartTracing(config)
|
|
|
| + def ComputeTotalDurations(self, timeline_model, name):
|
| + events = timeline_model.GetAllEventsOfName(name)
|
| + event_durations = [d.duration for d in events]
|
| + assert event_durations, 'Failed to find durations'
|
| +
|
| + duration_sum = sum(event_durations)
|
| + return duration_sum
|
| +
|
| def ComputeAverageOfDurations(self, timeline_model, name):
|
| events = timeline_model.GetAllEventsOfName(name)
|
| event_durations = [d.duration for d in events]
|
| @@ -36,18 +43,32 @@ class DrawProperties(legacy_page_test.LegacyPageTest):
|
| duration_avg = duration_sum / duration_count
|
| return duration_avg
|
|
|
| + def CountNumbers(self, timeline_model, name):
|
| + events = timeline_model.GetAllEventsOfName(name)
|
| +
|
| + duration_count = len(events)
|
| + return duration_count
|
| +
|
| def ValidateAndMeasurePage(self, page, tab, results):
|
| del page # unused
|
| timeline_data = tab.browser.platform.tracing_controller.StopTracing()
|
| timeline_model = model.TimelineModel(timeline_data)
|
|
|
| - pt_avg = self.ComputeAverageOfDurations(
|
| + bld_sum = self.ComputeAverageOfDurations(
|
| + timeline_model,
|
| + 'LayerTreeHost::UpdateLayers::BuildPropertyTrees')
|
| +
|
| + cdp_sum = self.ComputeAverageOfDurations(
|
| timeline_model,
|
| - 'LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees')
|
| + 'LayerTreeImpl::UpdateDrawProperties::CalculateDrawProperties')
|
| +
|
| + results.AddValue(scalar.ScalarValue(
|
| + results.current_page, 'PT_build_cost', 'ms', bld_sum,
|
| + description='Total time spent building property trees'))
|
|
|
| results.AddValue(scalar.ScalarValue(
|
| - results.current_page, 'PT_avg_cost', 'ms', pt_avg,
|
| - description='Average time spent processing property trees'))
|
| + results.current_page, 'Impl_cdp_cost', 'ms', cdp_sum,
|
| + description='Total time spent calculating draw properties'))
|
|
|
| def DidRunPage(self, platform):
|
| tracing_controller = platform.tracing_controller
|
|
|