Class: MetricsBuffer
Experimental
A buffer that can be set on RuntimeOptions.telemetry.metricsExporter to record metrics instead of ignoring/exporting them.
It is important that the buffer size is set to a high number and that retrieveUpdates is
called regularly to drain the buffer. If the buffer is full, metric updates will be dropped
and an error will be logged.
Buffered metrics is an experimental feature. APIs may be subject to change.
Constructors
Constructor
new MetricsBuffer(
options?):MetricsBuffer
Experimental
Parameters
options?
Returns
MetricsBuffer
Properties
maxBufferSize
readonlymaxBufferSize:number
Experimental
useSecondsForDurations
readonlyuseSecondsForDurations:boolean
Experimental
Methods
retrieveUpdates()
retrieveUpdates():
ArrayIterator<BufferedMetricUpdate>
Experimental
Retrieve buffered metric updates.
This method drains the metrics buffer and returns all metric events that have accumulated since the last call to this method. This method should be called regularly when using buffered metrics to prevent buffer overflow.
Returns
ArrayIterator<BufferedMetricUpdate>
Array of buffered metric updates, each containing the metric metadata, current value, and attributes Buffered metrics is an experimental feature. APIs may be subject to change.