NewUserSkills

toloka.metrics.metrics.NewUserSkills | Source code

NewUserSkills(
self,
skill_id: str,
cursor_time_lag: timedelta = ...,
count_name: Optional[str] = None,
value_name: Optional[str] = None,
join_events: bool = False,
*,
toloka_client: Optional[TolokaClient] = None,
atoloka_client: Optional[AsyncTolokaClient] = None,
timeout: timedelta = ...
)

Tracking Tolokers' skills.

Parameters description

ParametersTypeDescription
skill_idstr

Which skill we will be tracking.

cursor_time_lagtimedelta

Time lag for cursor. This controls time lag between user skills being updated and this metric being updated. See BaseCursor.time_lag for details and reasoning behind this.

count_nameOptional[str]

Metric name for a count of new skill assignments. When skill changes it counts to.

value_nameOptional[str]

Metric name for exact values of new skill level for each skill assignment. It could be useful to track mean value or some medians.

join_eventsbool

Count all events in one point. Default False. "Values" never join.

Examples:

How to collect this metrics:

def print_metric(metric_dict):
print(metric_dict)
collector = MetricCollector
(
[
NewUserSkills(
toloka_client=toloka_client,
count_name='count',
value_name='values',
)
],
print_metric
)
asyncio.run(collector.run())
{
'count': [(datetime.datetime(2021, 11, 18, 8, 31, 54, 11000), 1)],
'values': [(datetime.datetime(2021, 11, 18, 8, 31, 54, 11000), Decimal('50.000000000000'))],
}

Methods summary

MethodDescription
get_line_namesReturns a list of metric names that can be generated by this class instance.

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming