运行初始安装大约需要20分钟,运行salt-call state.highstate大约需要6分钟。这不是不合理的,但我想加快速度,但我不知道如何找到最慢的状态。
除了用秒表看我的屏幕6分钟外,还有其他方法可以找到每个州运行多长时间吗?
发布于 2015-04-24 16:46:09
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']https://stackoverflow.com/questions/29852817
复制相似问题