distributed 2021.10.0

ParametersReturnsBackRef
get_task_stream(self, start=None, stop=None, count=None, plot=False, filename='task-stream.html', bokeh_resources=None)

This collects the data present in the diagnostic "Task Stream" plot on the dashboard. It includes the start, stop, transfer, and deserialization time of every task for a particular duration.

Note that the task stream diagnostic does not run by default. You may wish to call this function once before you start work to ensure that things start recording, and then again after you have completed.

Parameters

start : Number or string

When you want to start recording If a number it should be the result of calling time() If a string then it should be a time difference before now, like '60s' or '500 ms'

stop : Number or string

When you want to stop recording

count : int

The number of desired records, ignored if both start and stop are specified

plot : boolean, str

If true then also return a Bokeh figure If plot == 'save' then save the figure to a file

filename : str (optional)

The filename to save to if you set plot='save'

bokeh_resources : bokeh.resources.Resources (optional)

Specifies if the resource component is INLINE or CDN

Returns

L: List[Dict]

Get task stream data from scheduler

See Also

get_task_stream

a context manager version of this method

Examples

This example is valid syntax, but we were not able to check execution
>>> client.get_task_stream()  # prime plugin if not already connected
... x.compute() # do some work
... client.get_task_stream() [{'task': ..., 'type': ..., 'thread': ..., ...}]

Pass the plot=True or plot='save' keywords to get back a Bokeh figure

This example is valid syntax, but we were not able to check execution
>>> data, figure = client.get_task_stream(plot='save', filename='myfile.html')

Alternatively consider the context manager

This example is valid syntax, but we were not able to check execution
>>> from dask.distributed import get_task_stream
... with get_task_stream() as ts:
...  x.compute()
... ts.data [...]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

distributed.client.Client.get_task_stream

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /distributed/client.py#3942
type: <class 'function'>
Commit: