get_analytics

toloka.async_client.client.AsyncTolokaClient.get_analytics | Source code

async get_analytics(self, stats: List[AnalyticsRequest])

Sends analytics queries, for example, to estimate the percentage of completed tasks in the pool

Only pool analytics queries are available. The values of different analytical metrics will be returned in the "details" field of the operation when it is completed. See the example. You can request up to 10 metrics at a time.

Parameters Description

ParametersTypeDescription
statsList[AnalyticsRequest]

Analytics queries list.

  • Returns:

    An operation that you can wait for to get the required statistics.

  • Return type:

    Operation

Examples:

How to get task completion percentage for one pool.

from toloka.client.analytics_request import CompletionPercentagePoolAnalytics
operation = toloka_client.get_analytics([CompletionPercentagePoolAnalytics(subject_id=pool_id)])
operation = toloka_client.wait_operation(operation)
print(operation.details['value'][0]['result']['value'])
Toloka-Kit
OverviewGetting OAuth tokenQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming