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 | Type | Description |
---|---|---|
metrics | List[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. |
header | str | Your pretty header for this dashboard. |
update_seconds | int | Count of seconds between dash updates. |
min_time_range | timedelta | The minimum time range for all charts. |
max_time_range | timedelta | 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 metricsfrom toloka.metrics.jupyter_dashboard import Chart, DashBoardimport toloka.client as tolokatoloka_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()
Method | Description |
---|---|
run_dash | Starts dashboard. Starts server for online updating charts. |
stop_dash | Stops server. And stops updating dashboard. |
update_charts | Redraws all charts on each iteration |