Drain

class metricq.Drain(*args, queue, metrics, **kwargs)
__init__(*args, queue, metrics, **kwargs)

Drain the given queue of all buffered metric data

Parameters:
queue : str

The name of the queue that contains the subscribed data.

metrics : Iterable[str]

Metrics that you want to subscribe to.

await connect()

Connect to the MetricQ network

Return type:

None

__aiter__()

Allows to asynchronously iterate over all metric data as it gets received.

Use it like this:

async for metric, time, value in my_drain:
    pass
Return type:

Drain

await __aenter__()

Allows to use the Client as a context manager.

The connection to MetricQ will be automatically established and closed.

Use it like this:

async with MyClient(...) as client:
    pass
Return type:

TypeVar(Self, bound= Client)