运行初始安装大约需要 20 分钟,运行salt-call state.highstate
大约需要6分钟。这并非不合理,但我想加快速度,但我不知道如何找到最慢的状态。
除了用秒表观看屏幕 6 分钟之外,还有什么方法可以找到每个状态运行需要多长时间?
sudo salt-call state.highstate
提供每个状态的开始时间和持续时间。
----------
ID: ntp-removed
Function: pkg.removed
Result: True
Comment: None of the targeted packages are installed
Started: 12:45:04.430901
Duration: 0.955 ms
Changes:
您可以捕获此信息进行处理:
salt-call state.highstate test=True --out json | tee output.json
python -c 'import json; j=json.load(open("output.json"))["local"];\
print [x["name"] for x in j.values() if x["duration"] > 1000];'
[u'munin-node']
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)