While it does not appear to be possible to save directly with get_task_stream
, you can use the bokeh
figure stored in the task stream object as ts.figure
:
from dask.distributed import Client, get_task_stream
import time
client = Client()
with get_task_stream(client, plot='save', filename='task_stream.html') as ts:
futs = client.map(lambda x: time.sleep(x**2), range(5))
results = client.gather(futs)
from bokeh.io import export_png
# note to use this you will need to install additional modules
# conda install -c conda-forge firefox geckodriver
# or see https://docs.bokeh.org/en/latest/docs/user_guide/export.html
export_png(ts.figure, filename="plot.png")
There are other ways of exporting the bokeh figures, see docs.