# tensorplay.distributed.elastic.metrics API Source: https://www.tensorplay.cn/docs/api/tensorplay.distributed.elastic.metrics.html ## Functions 2 [#](#api-tensorplay.distributed.elastic.metrics.configure) ### configure function[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.metrics.configure.html) ```python tensorplay.distributed.elastic.metrics.configure(handler: MetricHandler, group: str | None = None) → None ``` Route group (or all groups) to handler. [#](#api-tensorplay.distributed.elastic.metrics.prof) ### prof function[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.metrics.prof.html) ```python tensorplay.distributed.elastic.metrics.prof(fn=None, group: str = 'tp_elastic', interval_ms: float = 1000) ``` Decorator measuring wall time of fn and emitting it as a metric. Works both bare (@prof) and parameterized (@prof(group=...)). ## Classes 1 [#](#api-tensorplay.distributed.elastic.metrics.MetricsConfig) ### MetricsConfig class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.metrics.MetricsConfig.html) ```python class tensorplay.distributed.elastic.metrics.MetricsConfig(params: dict[str, str] | None = None, default_handler: str = 'console', cfg: dict[str, str] | None = None) ``` Metric plumbing configuration; maps groups to handler names.