2

What is the command line options to use Erlang etop to dump Erlang program information to a file? If this cannot be done in command line, can it be done in an escript?

aronisstav
  • 7,755
  • 5
  • 23
  • 48

1 Answers1

2

This is what I found in my Makefile:

run_etop:
    erl -name node@127.0.0.1 -setcookie cookie -pa ebin/ -detached -s app
    erl -name etop@127.0.0.1 -noinput -s etop -s erlang halt -output text \
    -setcookie cookie -interval 1 -lines 20 -accumulate true > etop.log

I start my application (app) on node@127.0.0.1 and then I start another node (etop@127.0.0.1) from which I connect to the first node and where I run etop.

To get list of etop options, try etop:help() in erlang console.

juro
  • 631
  • 5
  • 13
  • 1
    Instead of continuously output data every "interval" time, can etop just output data once? Your example using "> etop.log" does not cause etop to overwrite the last output data, instead the log file keeps growing. I looked at etop:help() and cannot find an option to do that. – user2288740 Apr 17 '13 at 17:14
  • 1
    You could just use `tail` command to get the last output from the log file. – juro Apr 18 '13 at 08:30