runtimepy.net.arbiter.housekeeping package#

Module contents#

A module implementing various housekeeping tasks for the connection-arbiter runtime.

class runtimepy.net.arbiter.housekeeping.ConnectionMetricsLogger(name: str, average_depth: int = 10, metrics: PeriodicTaskMetrics = None, period_s: float = 1.0, env: ChannelEnvironment = None, period_controls: dict[str, int | float | bool | dict[str, int | float | bool]] | str = 'period', markdown: str = None, config: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None)[source]#

Bases: ArbiterTask

A task for logging metrics.

app: AppInfo#
async dispatch() bool[source]#

Dispatch an iteration of this task.

async init(app: AppInfo) None[source]#

Initialize this task with application information.

class runtimepy.net.arbiter.housekeeping.ConnectionMetricsLoggerFactory[source]#

Bases: TaskFactory[ConnectionMetricsLogger]

A factory for the connection-metrics logger.

kind#

alias of ConnectionMetricsLogger

class runtimepy.net.arbiter.housekeeping.ConnectionMetricsPoller(name: str, manager: ConnectionManager, **kwargs)[source]#

Bases: ArbiterTask

A class that periodically polls connection metrics.

async dispatch() bool[source]#

Dispatch an iteration of this task.

processors: list[Awaitable[None]]#
runtimepy.net.arbiter.housekeeping.housekeeping(manager: ConnectionManager, period_s: float = 0.1, poll_connection_metrics: bool = True) ConnectionMetricsPoller[source]#

Create a metrics-polling task.

async runtimepy.net.arbiter.housekeeping.init(app: AppInfo) int[source]#

Perform some initialization tasks.