Etop
类似top命令,查看erlang进程占用cpu、内存较高的进程
参数:
node atom erlang node
port integer The used port
accumulate boolean If true execution time is accumulated
lines integer Number of displayed processes
interval integer Display update interval in secs
sort runtime | reductions | memory | msg_q
output graphical | text
tracing on | off
setcookie string
使用举例:
1. 找出cpu占用最高的进程,图形界面输出,每10秒更新一次
> spawn(fun() -> etop:start([{interval,10}, {sort, runtime}]) end).
> etop:stop().
2. 找出内存占用较高进程, 输出进程的数量为20,文本形式输出
> spawn(fun() -> etop:start([{output, text}, {lines, 20}, {sort, memory}]) end).
> etop:stop().
3. 查看远程节点etop:
> erl -name abc@192.168.17.102 -hidden -s etop -output text -sort memory -lines 20 -node 'test@192.168.17.102' -setcookie mycookie123
或者:
> erl -name abc@192.168.17.102 -hidden
> etop:start([{node,'test@192.168.17.102'}, {setcookie, "mycookie123"}, {output, text}, {lines, 20}, {sort, memory}])
rpc:call
<