Toloka documentation

PoolCompletedPercentage

toloka.metrics.pool_metrics.PoolCompletedPercentage | Source code

PoolCompletedPercentage(
    self,
    pool_id: str,
    percents_name: Optional[str] = None,
    *,
    toloka_client: Optional[TolokaClient] = None,
    atoloka_client: Optional[AsyncTolokaClient] = None,
    timeout: timedelta = ...
)

Track pool completion in percentage

You can't gather this metric from a pool with infinite task suites. For example, if you have infinite overlap on a pool.

Parameters Description

Parameters Type Description
pool_id str

From which pool track metrics.

percents_name Optional[str]

Metric name for pool completion percentage. Default 'completion_percentage'.

toloka_client Optional[TolokaClient]

Client for connection to Toloka. You can set toloka_client for several metrics via "bind_client" function.

Examples:

How to collect this metric:

def print_metric(metric_dict):
    print(metric_dict)
collector = MetricCollector([PoolCompletedPercentage(pool_id, toloka_client=toloka_client)], print_metric)
asyncio.run(collector.run())

Methods Summary

Method Description
get_line_names Returns a list of metric names that can be generated by this class instance.