findMetricByName method

Metric? findMetricByName(
  1. String name
)

Returns the most-recently exported metric named name, or null if none match.

Implementation

Metric? findMetricByName(String name) {
  for (var i = _metrics.length - 1; i >= 0; i--) {
    if (_metrics[i].name == name) return _metrics[i];
  }
  return null;
}