asyncworker.metrics package#

Subpackages#

Submodules#

asyncworker.metrics.aiohttp_resources module#

async asyncworker.metrics.aiohttp_resources.http_metrics_middleware(request: aiohttp.web_request.Request, handler: Callable[[aiohttp.web_request.Request], Awaitable[aiohttp.web_response.Response]])[código fonte]#
async asyncworker.metrics.aiohttp_resources.metrics_route_handler(request: aiohttp.web_request.Request) aiohttp.web_response.Response[código fonte]#
asyncworker.metrics.aiohttp_resources.route_path_for_request(request: aiohttp.web_request.Request) str[código fonte]#

asyncworker.metrics.buckets module#

asyncworker.metrics.buckets.exponential_buckets(start: float, factor: float, count: int) List[float][código fonte]#

Creates ‘count’ buckets, where the lowest bucket has an upper bound of ‘start’ and each following bucket’s upper bound is ‘factor’ times the previous bucket’s upper bound. The final +Inf bucket is not counted and is included in the returned slice. The returned list is meant to be used for the buckets field of Histogram.

>>> exponential_buckets(start=100.0, factor=2, count=5)
[100.0, 200.0, 400.0, 800.0, 1600.0, inf]
>>> exponential_buckets(start=100.0, factor=2.5, count=5)
[100.0, 250.0, 625.0, 1562.5, 3906.25, inf]
asyncworker.metrics.buckets.linear_buckets(start: float, width: float, count: int) List[float][código fonte]#

Creates ‘count’ buckets, each ‘width’ wide, where the lowest bucket has an upper bound of ‘start’. The final +Inf bucket is not counted and is included in the returned slice. The returned list is meant to be used for the buckets field of Histograms.

>>> linear_buckets(start=100.0, width=100, count=5)
[100.0, 200.0, 300.0, 400.0, 500.0, inf]
>>> linear_buckets(start=100.0, width=1000, count=5)
[100.0, 1100.0, 2100.0, 3100.0, 4100.0, inf]

asyncworker.metrics.registry module#

asyncworker.metrics.types module#

class asyncworker.metrics.types.Counter(name: str, documentation: str, **kwargs)[código fonte]#

Base: asyncworker.metrics.types.Metric, prometheus_client.metrics.Counter

class asyncworker.metrics.types.Gauge(name: str, documentation: str, **kwargs)[código fonte]#

Base: asyncworker.metrics.types.Metric, prometheus_client.metrics.Gauge

class asyncworker.metrics.types.Histogram(name: str, documentation: str, **kwargs)[código fonte]#

Base: asyncworker.metrics.types.Metric, prometheus_client.metrics.Histogram

class asyncworker.metrics.types.Metric[código fonte]#

Base: object

Module contents#