用法:
get_task_stream(start=None, stop=None, count=None, plot=False, filename='task-stream.html', bokeh_resources=None)
從調度器獲取任務流數據
這會收集儀表板上診斷 “Task Stream” 圖中存在的數據。它包括特定持續時間內每個任務的啟動、停止、傳輸和反序列化時間。
請注意,默認情況下不運行任務流診斷。您可能希望在開始工作之前調用此函數一次,以確保事情開始記錄,然後在完成後再次調用。
- start:數字或字符串
何時開始錄製 如果是數字,則應該是調用time()的結果 如果是字符串,則應該是現在之前的時間差,例如'60s'或'500 ms'
- stop:數字或字符串
當您想停止錄製時
- count:int
所需記錄的數量,如果同時指定了 start 和 stop 則忽略
- plot:布爾值,str
如果為真,則還返回散景圖 如果 plot == ‘save’ 然後將圖保存到文件
- filename:str(可選)
如果您設置
plot='save'
,則保存到的文件名- bokeh_resources:bokeh.resources.Resources(可選)
指定資源組件是 INLINE 還是 CDN
- L:列表[字典]
參數:
返回:
例子:
>>> client.get_task_stream() # prime plugin if not already connected >>> x.compute() # do some work >>> client.get_task_stream() [{'task': ..., 'type': ..., 'thread': ..., ...}]
傳遞
plot=True
或plot='save'
關鍵字以獲取散景圖>>> data, figure = client.get_task_stream(plot='save', filename='myfile.html')
或者考慮上下文管理器
>>> from dask.distributed import get_task_stream >>> with get_task_stream() as ts: ... x.compute() >>> ts.data [...]
相關用法
- Python distributed.Client.get_versions用法及代碼示例
- Python distributed.Client.get用法及代碼示例
- Python distributed.Client.gather用法及代碼示例
- Python distributed.Client.ncores用法及代碼示例
- Python distributed.Client.retire_workers用法及代碼示例
- Python distributed.Client.unregister_worker_plugin用法及代碼示例
- Python distributed.Client.set_metadata用法及代碼示例
- Python distributed.Client.scheduler_info用法及代碼示例
- Python distributed.Client.submit用法及代碼示例
- Python distributed.Client.compute用法及代碼示例
- Python distributed.Client.nthreads用法及代碼示例
- Python distributed.Client.unpublish_dataset用法及代碼示例
- Python distributed.Client.start_ipython_scheduler用法及代碼示例
- Python distributed.Client.publish_dataset用法及代碼示例
- Python distributed.Client.who_has用法及代碼示例
- Python distributed.Client.profile用法及代碼示例
- Python distributed.Client.run用法及代碼示例
- Python distributed.Client.register_worker_plugin用法及代碼示例
- Python distributed.Client.map用法及代碼示例
- Python distributed.Client.log_event用法及代碼示例
注:本文由純淨天空篩選整理自dask.org大神的英文原創作品 distributed.Client.get_task_stream。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。