foreman-packaging icon indicating copy to clipboard operation
foreman-packaging copied to clipboard

Add rubygems for profiling and performance analyzing

Open m-bucher opened this issue 1 year ago • 6 comments

Would it make sense to add a tool for profiling the rails requests? https://github.com/MiniProfiler/rack-mini-profiler

Requires: https://github.com/theforeman/foreman/pull/9897

Fixes #36898

m-bucher avatar Nov 07 '23 11:11 m-bucher

Perhaps, but then I'd expect a foreman-profiling package that pulls these gems in. To achieve that, we have bundler.d and subpackages in foreman.spec. For foreman-proxy there's a similar setup. The benefit is that it's easier for end users to set up and for packagers we'd benefit from automatic updates to these gems.

ekohl avatar Nov 07 '23 13:11 ekohl

@ekohl agreed. I have a remaining question: Adding bundler.d/profiling.rb could either be done in the spec-file or by adding it to https://github.com/theforeman/foreman. The downside of adding it to foreman directly is that it will automatically be enabled on dev-boxes as well. Is that OK or is there a third option I currently just do not see. I could add it as bundler.d/profiling.rb.off, but that seems hacky as well :thinking:

m-bucher avatar Nov 07 '23 13:11 m-bucher

The correct solution is in foreman.git. Otherwise you have all the downsides and none of the upsides. Automatic packages updates won't work, we need to keep it in sync between Debian and RPM.

You actually have optional groups in bundler: https://bundler.io/guides/groups.html#optional-groups-and-bundlewith

group :profiling, optional: true do
  # ...
end

ekohl avatar Nov 07 '23 14:11 ekohl

I see, can I achieve the group becoming active by installing the foreman-profiling sub-package? I would assume I have to configure it somewhere. Maybe as a %post in the spec-file.

m-bucher avatar Nov 07 '23 14:11 m-bucher

I see, can I achieve the group becoming active by installing the foreman-profiling sub-package? I would assume I have to configure it somewhere. Maybe as a %post in the spec-file.

I'd patch the optional: true part out in packaging with a simple sed statement. That needs to be duplicated for Debian and RPM, but once implemented it shouldn't change.

ekohl avatar Nov 07 '23 14:11 ekohl

@ekohl is this ready to merge now?

m-bucher avatar Apr 08 '24 14:04 m-bucher