DefaultMetricsRegistry
Defined in: src/metrics/Metrics.ts:227
Default in-memory implementation. Thread-safe by virtue of being single-threaded (Bun + Node both run JS on a single thread per Worker; metrics live on the main thread of an ActorSystem).
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DefaultMetricsRegistry():
DefaultMetricsRegistry
Returns
Section titled “Returns”DefaultMetricsRegistry
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Defined in: src/metrics/Metrics.ts:283
Wipe the registry — primarily for tests.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”collect()
Section titled “collect()”collect(): readonly
MetricSample[]
Defined in: src/metrics/Metrics.ts:246
Snapshot every series as a flat list of MetricSamples.
Returns
Section titled “Returns”readonly MetricSample[]
Implementation of
Section titled “Implementation of”counter()
Section titled “counter()”counter(
name,labels?,opts?):Counter
Defined in: src/metrics/Metrics.ts:230
Get-or-create a counter family. Same (name, help) returns the
same family across calls; labels selects (or creates) a child
series within it.
Parameters
Section titled “Parameters”string
labels?
Section titled “labels?”Labels = {}
CounterOptions = {}
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”gauge()
Section titled “gauge()”gauge(
name,labels?,opts?):Gauge
Defined in: src/metrics/Metrics.ts:235
Parameters
Section titled “Parameters”string
labels?
Section titled “labels?”Labels = {}
GaugeOptions = {}
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”histogram()
Section titled “histogram()”histogram(
name,labels?,opts?):Histogram
Defined in: src/metrics/Metrics.ts:240
Parameters
Section titled “Parameters”string
labels?
Section titled “labels?”Labels = {}
HistogramOptions = {}