Skip to content

Add Gitlab::Profiler for profiling from a console or runner

Sean McGivern requested to merge add-profiler-to-application into master

What does this MR do?

Gitlab::Profiler.profile takes a URL to profile, and returns the ruby-prof profile result.

This is currently only for interactive use (in a console) or from the script runner. Note that when using this interactively, changes to the application within that console session will be used, so this can be used to test proposed performance changes.

Are there points in the code the reviewer needs to double check?

All of it! It's mostly copied from https://gitlab.com/gitlab-com/gitlab-profiler/blob/64c1eb1e041869dbe271ddd4f7a942e1ff0535fc/profile_url.rb, but I did make quite a few tweaks to avoid interfering with the rest of the application, so we can in future use this from the UI, maybe!

Why was this MR needed?

It makes profiling easier than 'update https://gitlab.com/gitlab-com/gitlab-profiler and ping @stanhu' for people who have VPN access.

Does this MR meet the acceptance criteria?

  • Tests added for this feature/bug
  • Review
    • Has been reviewed by Backend

Merge request reports