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.
Updated by The Foreman Bot almost 4 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/8273 added
Updated by Lukas Zapletal almost 4 years ago
- Related to Bug #31679: Actions that load the Rails stack are slow added
Updated by Lukas Zapletal over 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|50dacf3beeaece11b8198a7140cc485b7bc7f09a.
Actions