Make using profiler from Omnibus more convenient
We have bin/profile-url
, but this won't work in Omnibus, because bin
isn't writable. As gitlab-com/gitlab-profiler@8fec998f explains:
# Unless you have write access to the directory where the profiler script
# lives, Rails won't attempt to run the script. We copy it to /tmp to
# workaround this problem.
One option to address this might be to remove all of the logic from bin/profile-url
and move it to something that can be called easily either from the command line or from a console. That way, Omnibus users could write gitlab-rails r 'Gitlab::Profiler::Cli.start' -o ...
and wouldn't need a writable directory.
(This should work: bundle exec rails r 'p ARGV' 1 2 3 --foo=bar
prints ["1", "2", "3", "--foo=bar"]
)
/cc @stanhu