Add an API endpoint for profiling
I'd like to add the profiler to chatops. However, chatops doesn't have (or want) ssh access.
We could expose the profiler as an API endpoint, and require an administrator token. That would be easier to integrate into other tools. However, that still has some issues:
- We'd need one API endpoint to generate the profile request, and a second to fetch it.
- These can take more than the 60 second Unicorn timeout.
- That implies running the profile in Sidekiq.
- That also implies the caller having a responsibility to poll for results.
- We would also need to store the results somewhere. If it comes to it, we could just throw the HTML and SQL logs in Redis, but it would probably be nicer to be able to configure or pass an object storage bucket somewhere.
@stanhu do you think this a good idea? The more I write about it, the more inconvenient it seems