gatling icon indicating copy to clipboard operation
gatling copied to clipboard

Running Tasks, Getting Logs

Open kmarsh opened this issue 8 years ago • 1 comments

I was able to get gatling setup with little fuss (which is sweet!) but being new to Erlang, Elxir, and Phoenix I'm at a little bit of a loss for how to perform some administrative tasks on the server.

I think it'd be useful for people like me to know the how to run the Phoenix equivalents of the Rails world's:

  • tail -f log/production.log
  • rails console
  • rails runner "Model.long_running_command"

I'm digging around and will be happy to submit a PR to the docs once I figure this out, but some best practice guidance would be appreciated!

kmarsh avatar Feb 23 '17 17:02 kmarsh

Figured out the console and logs bit:

Console

sudo service [app_name] remote_console

Logs

tail -f deployments/[app_name]/var/log/*

I'm still struggling with a runner equivalent. sudo service [app_name] has a few promising-looking options: escript, rpc, eval, and command. I tried a ton of variations with these but couldn't get anything to work (e.g., command throws "shift: can't shift that many" errors for anything I throw at it). Are these supposed to be given Erlang code, not Elixir code?

            echo "escript <file>                 # execute an escript"
            echo "rpc <mod> <fun> [<args..>]     # execute an RPC call using the given MFA"
            echo "rpcterms <mod> <fun> [<expr>]  # execute an RPC call using the given Erlang expression for args"
            echo "eval <expr>                    # execute the given Erlang expression on the running node"
            echo "command <mod> <fun> [<args..>] # execute the given MFA"

kmarsh avatar Apr 09 '17 19:04 kmarsh