class documentation

A buffer that can be set on TelemetryConfig to record metrics instead of ignoring/exporting them.

Warning

It is important that the buffer size is set to a high number and that retrieve_updates is called regularly to drain the buffer. If the buffer is full, metric updates will be dropped and an error will be logged.

Method __init__ Create a buffer with the given size.
Method retrieve_updates Drain the buffer and return all metric updates.
Instance Variable _buffer_size Undocumented
Instance Variable _durations_as_seconds Undocumented
Instance Variable _runtime Undocumented
def __init__(self, buffer_size: int, duration_format: MetricBufferDurationFormat = MetricBufferDurationFormat.MILLISECONDS): (source)

Create a buffer with the given size.

Warning

It is important that the buffer size is set to a high number and is drained regularly. See MetricBuffer warning.

Parameters
buffer_size:intSize of the buffer. Set this to a large value. A value in the tens of thousands or higher is plenty reasonable.
duration_format:MetricBufferDurationFormatWhich duration format to use.
def retrieve_updates(self) -> Sequence[BufferedMetricUpdate]: (source)

Drain the buffer and return all metric updates.

Warning

It is important that this is called regularly. See MetricBuffer warning.

Returns
Sequence[BufferedMetricUpdate]A sequence of metric updates.
_buffer_size = (source)

Undocumented

_durations_as_seconds = (source)

Undocumented

Undocumented