Toloka documentation

SpentBudgetOnPool

toloka.metrics.pool_metrics.SpentBudgetOnPool | Source code

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

How much money has already been spent on this pool, excluding fee.

Parameters Description

Parameters Type Description
pool_id str

From which pool track metrics.

tasks_name -

Metric name for a count of tasks.

Examples:

How to collect this metrics:

def print_metric(metric_dict):
    print(metric_dict)

collector = MetricCollector([SpentBudgetOnPool(pool_id, toloka_client=toloka_client)], print_metric)
asyncio.run(collector.run())
'spent_money': [(datetime.datetime(2021, 11, 18, 9, 36, 34, 163000), Decimal('0.3'))],

}

Methods Summary

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