Actions
Bug #31715
closedPrint debugging timing information for initializer
Description
In order to find which initializers are the slowest, we should add time measuring. It should work also with plugins, thus dynamically. All initializers that are slower than a sane threashold (100ms) are print into the debug logger, like this:
2021-01-25T13:01:34 [D|app|] Slow initializers: 2021-01-25T13:01:34 [D|app|] 130.85 ./config/initializers/apipie.rb 2021-01-25T13:01:34 [D|app|] 791.64 ./config/initializers/foreman.rb 2021-01-25T13:01:34 [D|app|] 2165.86 ./config/initializers/1_fast_gettext.rb
There is an excellent library https://github.com/nevir/Bumbler which does exactly that plus it can also track Bundler require timings, but it requires Bundler to be present. Foreman only uses Bundler for development and debian deployments, but on EL bundler_ext stub is used instead of that. Therefore the gem cannot be used, let's just implement timing of initializers ourselves.
Actions