用法:
dask.diagnostics.ResourceProfiler(dt=1)
用於資源使用的分析器。
- 記錄以下每個時間步長
自紀元以來的時間(以秒為單位)
內存使用量 (MB)
% CPU使用率
例子:
>>> from operator import add, mul >>> from dask.threaded import get >>> dsk = {'x': 1, 'y': (add, 'x', 10), 'z': (mul, 'y', 2)} >>> with ResourceProfiler() as prof: ... get(dsk, 'z') 22
這些結果可以使用
visualize
方法在散景圖中可視化。請注意,這需要安裝散景。>>> prof.visualize()
您可以全局激活分析器
>>> prof.register()
如果您在全局範圍內使用分析器,則需要手動清除舊結果。
>>> prof.clear()
請注意,當用作上下文管理器時,數據將在封閉塊的整個持續時間內收集。相反,當全局注冊時,隻會在 dask 調度程序處於活動狀態時收集數據。
>>> prof.unregister()
相關用法
- Python dask.diagnostics.Profiler用法及代碼示例
- Python dask.diagnostics.CacheProfiler用法及代碼示例
- Python dask.diagnostics.Callback用法及代碼示例
- Python dask.diagnostics.ProgressBar用法及代碼示例
- Python dask.distributed.SSHCluster用法及代碼示例
- Python dask.distributed.get_task_stream用法及代碼示例
- Python dask.distributed.progress用法及代碼示例
- Python dask.dataframe.Series.apply用法及代碼示例
- Python dask.dataframe.to_records用法及代碼示例
- Python dask.dataframe.DataFrame.applymap用法及代碼示例
- Python dask.dataframe.Series.clip用法及代碼示例
- Python dask.dataframe.Series.prod用法及代碼示例
- Python dask.dataframe.Series.fillna用法及代碼示例
- Python dask.dataframe.DataFrame.sub用法及代碼示例
- Python dask.dataframe.compute用法及代碼示例
- Python dask.dataframe.DataFrame.mod用法及代碼示例
- Python dask.dataframe.Series.to_frame用法及代碼示例
- Python dask.dataframe.read_table用法及代碼示例
- Python dask.dataframe.read_hdf用法及代碼示例
- Python dask.dataframe.Series.sum用法及代碼示例
注:本文由純淨天空篩選整理自dask.org大神的英文原創作品 dask.diagnostics.ResourceProfiler。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。