DashBoard

toloka.metrics.jupyter_dashboard.DashBoard | Source code

DashBoard(
self,
metrics: List[Union[BaseMetric, Chart]],
header: str = 'Toloka metrics dashboard',
update_seconds: int = 10,
min_time_range: timedelta = ...,
max_time_range: timedelta = ...
)

Toloka dashboard with metrics. Only for jupyter.

Parameters description

ParametersTypeDescription
metricsList[Union[BaseMetric, Chart]]

List of metrics or charts, that will be displayed on the dashboard. Each element will be displayed in a separate chart (coordinates). If you want to draw several metrics in one coordinates, wrap it into an instance of the class Chart.

headerstr

Your pretty header for this dashboard.

update_secondsint

Count of seconds between dash updates.

min_time_rangetimedelta

The minimum time range for all charts.

max_time_rangetimedelta

The maximum time range for all charts. If you have more data, you will see only the last range on charts.

Examples:

How to create online dashboard in jupyter.

import toloka.metrics as metrics
from toloka.metrics.jupyter_dashboard import Chart, DashBoard
import toloka.client as toloka
toloka_client = toloka.TolokaClient(oauth_token, 'PRODUCTION')
new_dash = DashBoard(
[
metrics.Balance(),
metrics.AssignmentsInPool('123'),
metrics.AssignmentEventsInPool('123', submitted_name='submitted', join_events=True),
Chart(
'Manualy configured chart',
[metrics.AssignmentsInPool('123'), metrics.AssignmentsInPool('345'),]
)
],
header='My cool dash',
)
metrics.bind_client(new_dash.metrics, toloka_client)
# Then in new cell:
new_dash.run_dash()
# If you want to stop it:
new_dash.stop_dash()

Methods summary

MethodDescription
run_dashStarts dashboard. Starts server for online updating charts.
stop_dashStops server. And stops updating dashboard.
update_chartsRedraws all charts on each iteration

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