用法:
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。