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 | Type | Description |
---|---|---|
stats | List[AnalyticsRequest] | Analytics queries list. |
Returns:
An operation that you can wait for to get the required statistics.
Return type:
Examples:
How to get task completion percentage for one pool.
from toloka.client.analytics_request import CompletionPercentagePoolAnalyticsoperation = toloka_client.get_analytics([CompletionPercentagePoolAnalytics(subject_id=pool_id)])operation = toloka_client.wait_operation(operation)print(operation.details['value'][0]['result']['value'])