def _GetAllTimelineBasedMetrics(): # TODO(nednguyen): use discovery pattern to return all the instances of # all TimelineBasedMetrics class in web_perf/metrics/ folder. # This cannot be done until crbug.com/460208 is fixed. return (smoothness.SmoothnessMetric(), responsiveness_metric.ResponsivenessMetric(), layout.LayoutMetric(), gpu_timeline.GPUTimelineMetric())
def _GetMetricFromMetricType(metric_type): if metric_type == tir_module.IS_FAST: return fast_metric.FastMetric() if metric_type == tir_module.IS_SMOOTH: return smoothness.SmoothnessMetric() if metric_type == tir_module.IS_RESPONSIVE: return responsiveness_metric.ResponsivenessMetric() raise Exception('Unrecognized metric type: %s' % metric_type)
def CreateMetricsForTimelineInteractionRecord(self, interaction): """ Subclass of TimelineBasedMeasurement overrides this method to customize the binding of interaction's flags to metrics. """ res = [] if interaction.is_smooth: res.append(smoothness.SmoothnessMetric()) if interaction.is_responsive: res.append(responsiveness_metric.ResponsivenessMetric()) return res
def _GetAllTimelineBasedMetrics(): # TODO(nednguyen): use discovery pattern to return all the instances of # all TimelineBasedMetrics class in web_perf/metrics/ folder. # This cannot be done until crbug.com/460208 is fixed. return (smoothness.SmoothnessMetric(), responsiveness_metric.ResponsivenessMetric(), layout.LayoutMetric(), gpu_timeline.GPUTimelineMetric(), blob_timeline.BlobTimelineMetric(), memory_timeline.MemoryTimelineMetric(), text_selection.TextSelectionMetric(), indexeddb_timeline.IndexedDBTimelineMetric(), webrtc_rendering_timeline.WebRtcRenderingTimelineMetric())