createHistogram<T extends num> method
Creates a Histogram with the given name.
A Histogram is a synchronous Instrument which can be used to report arbitrary values that are likely to be statistically meaningful.
name The name of the instrument
unit Optional unit of the instrument (e.g., "ms" for milliseconds)
description Optional description of the instrument
boundaries Optional explicit bucket boundaries for the histogram
Implementation
APIHistogram<T> createHistogram<T extends num>({
required String name,
String? unit,
String? description,
List<double>? boundaries,
}) {
if (name.isEmpty) {
throw ArgumentError('Histogram name must not be empty');
}
return HistogramCreate.create<T>(
name: name,
unit: unit,
description: description,
enabled: enabled,
meter: this,
boundaries: boundaries,
);
}