createCounter<T extends num> method
Creates a Counter with the given name.
A Counter is a synchronous Instrument which supports non-negative increments.
name The name of the instrument
unit Optional unit of the instrument (e.g., "ms" for milliseconds)
description Optional description of the instrument
Implementation
APICounter<T> createCounter<T extends num>({
required String name,
String? unit,
String? description,
}) {
if (name.isEmpty) {
throw ArgumentError('Counter name must not be empty');
}
return CounterCreate.create<T>(
name: name,
unit: unit,
description: description,
meter: this,
);
}