buildMetricsRecorder function

MetricsRecorder buildMetricsRecorder(
  1. String? channelId
)

Implementation

@pragma('vm:prefer-inline')
MetricsRecorder buildMetricsRecorder(String? channelId) {
  if (!kMetrics ||
      !MetricsConfig.enabled ||
      channelId == null ||
      channelId.isEmpty) {
    return const NoopMetricsRecorder();
  }
  final m = MetricsRegistry().attach(channelId);
  return ActiveMetricsRecorder(m);
}