HistogramBuilder

class HistogramBuilder(name: String, buckets: List<Double>? = null) : MetricBuilder<Histogram>

Builder class for creating Histogram metrics.

Histograms are used to observe the distribution of values, such as request latencies or response sizes.

Parameters

name

The metric name.

buckets

Optional list of bucket boundaries for the histogram.

Constructors

Link copied to clipboard
constructor(name: String, buckets: List<Double>? = null)

Constructs a histogram builder.

Functions

Link copied to clipboard
open override fun build(): Histogram

Builds and returns the Histogram instance.

Link copied to clipboard
fun help(help: String)

Sets the help description for the metric.

Link copied to clipboard
fun labelNames(vararg labelNames: String)

Sets the label names that this metric will use.

Link copied to clipboard
fun unit(unit: String)

Sets the unit of the metric.