collect method

collect all metrics and samples that are part of this Collector.

Implementation

@override
Future<Iterable<MetricFamilySamples>> collect() async {
  await collectCallback?.call(this);

  final samples = <Sample>[];
  _children.forEach((labelValues, child) =>
      samples.add(Sample(name, labelNames, labelValues, child.value)));

  return [MetricFamilySamples(name, MetricType.gauge, help, samples)];
}