-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rubygems for profiling and performance analyzing #9953
base: rpm/develop
Are you sure you want to change the base?
Conversation
66bbc44
to
477034a
Compare
Perhaps, but then I'd expect a |
@ekohl agreed. I have a remaining question: |
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 |
I see, can I achieve the group becoming active by installing the foreman-profiling sub-package? |
9bb5f38
to
4c97d2d
Compare
I'd patch the |
4c97d2d
to
1b5c101
Compare
|
||
%files profiling | ||
%{_datadir}/%{name}/bundler.d/profiling.rb | ||
%{_datadir}/%{name}/config/initializers/rack_mini_profiler.rb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think by default this means the file is present in both foreman
and foreman-profiling
. Be sure to check that.
It may also be fine to include it in core if it gracefully falls back if the dependencies aren't present. Though there may be a security concern so I'm not strict on that. Just want to make sure you're doing what you intend to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what I can say from trying it out is that in 'productive-mode, which means
Gemfile.In` is present, all available groups are loaded, regardless of it being optional or not.
When we use bundler, groups matter, but even though I do bundle --with profiling
, the group would have to be required somewhere in code like here: https://github.com/theforeman/foreman/blob/fa79806973c6de08b6d265ed1ae99c0ff4f06bd6/config/application.rb#L59
Assuming we want to have it in development
-environment and in production
, if it is installed, then I would keep it in bundler.d/profiling.rb
but add it to development
-group.
I think by default this means the file is present in both foreman and foreman-profiling. Be sure to check that.
AFAIK having the same filepath in multiple packages is a big NoNo in most packaging-frameworks and my first test suggests it is only in the foreman-profiling
package after build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what I can say from trying it out is that in
productive
-mode, which meansGemfile.In
is present, all available groups are loaded, regardless of it being optional or not.
That's due to bundler_ext, which we use on Red Hat. We don't on Debian. Perhaps this is a good excuse to drop bundler_ext usage. The original use case was that you could ignore gem dependencies in RPMs, for security patching. These days we just make sure the gem dependencies are correct.
AFAIK having the same filepath in multiple packages is a big NoNo in most packaging-frameworks and my first test suggests it is only in the
foreman-profiling
package after build.
I know I've seen weirdness with this in the past, so just wanted to highlight that it should be checked.
2a5933a
to
2d33def
Compare
2d33def
to
ca6ad16
Compare
ca6ad16
to
9a25b4c
Compare
Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
9a25b4c
to
3b49f77
Compare
@ekohl is this ready to merge now? |
Would it make sense to add a tool for profiling the rails requests?
https://github.com/MiniProfiler/rack-mini-profiler
Requires: theforeman/foreman#9897
Fixes #36898