Counter constructor

Counter({
  1. required String name,
  2. required String help,
  3. List<String> labelNames = const [],
  4. Collect<Counter>? collectCallback,
})

Construct a new Counter with a name, help text and optional labelNames. If labelNames are provided, use labels(...) to assign label values. The optional collectCallback is called at the beginning of collect and allows to update the value of the counter before collecting it.

Implementation

Counter({
  required String name,
  required String help,
  List<String> labelNames = const [],
  this.collectCallback,
}) : super(name: name, help: help, labelNames: labelNames);