fprof:start().
fprof:trace([start,{procs,processes()},{file,"/opt/fprof.trace"}]).
fprof:trace(stop).
fprof:profile([{file, "/opt/fprof.trace"}]).
fprof:analyse({dest,"fprof_result.analysis"}).
- cprof -- showoing call count
cprof:start(module).
{_, All} = cprof:analyze().
lists:sort(fun({_,C1},{_,C2}) -> C1>C2 end,[{MFA,C}||{_,_,F}<-All, {MFA,C} <- F]).
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
spawn(fun() -> etop:start([{output, text}, {interval, 10}, {lines, 20}, {sort, memory}]) end).
lists:usort(fun({_,M1},{_,M2}) -> M1 > M2 end, [{Pid,M}|| {Pid,{memory,M}}<-[{Pid,erlang:process_info(Pid,memory)} || Pid <- processes()]]).