用法:
dump_cluster_state(filename: str = 'dask-cluster-dump', exclude: collections.abc.Collection[str] =('run_spec',), format: Literal['msgpack', 'yaml'] = 'msgpack')
提取整個集群狀態的轉儲並保存到磁盤。這僅用於調試目的。
警告:客戶端的內存使用量可能很大。
結果將存儲在字典中:
{ "scheduler_info": {...}, "worker_info": { worker_addr: {...}, # worker attributes ... } }
- filename:
輸出文件名。將自動附加適當的文件後綴(
.msgpack.gz
或.yaml
)。- exclude:
應該從轉儲中排除的屬性名稱的集合,例如排除代碼、回溯、日誌等。
默認排除
run_spec
這是序列化的用戶代碼。這通常不是調試所必需的。要允許對此進行序列化,請傳遞一個空元組。- format:
msgpack 或 yaml。如果使用 msgpack(默認),輸出將作為 msgpack 存儲在 gzip 壓縮文件中。
閱讀:
import gzip, msgpack with gzip.open("filename") as fd: state = msgpack.unpack(fd)
或者:
import yaml try: from yaml import CLoader as Loader except ImportError: from yaml import Loader with open("filename") as fd: state = yaml.load(fd, Loader=Loader)
參數:
相關用法
- 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.get用法及代碼示例
- Python distributed.Client.publish_dataset用法及代碼示例
- Python distributed.Client.who_has用法及代碼示例
- Python distributed.Client.get_versions用法及代碼示例
- 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.dump_cluster_state。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。