Project

General

Profile

Bug #31715

Print debugging timing information for initializer

Added by Lukas Zapletal 5 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Development tools
Target version:
-
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

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.


Related issues

Related to Foreman - Bug #31679: Actions that load the Rails stack are slowNew

Associated revisions

Revision 50dacf3b (diff)
Added by Lukas Zapletal 3 months ago

Fixes #31715 - print slow initializers to debug log

History

#1 Updated by The Foreman Bot 5 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8273 added

#2 Updated by Lukas Zapletal 5 months ago

  • Related to Bug #31679: Actions that load the Rails stack are slow added

#3 Updated by The Foreman Bot 3 months ago

  • Fixed in Releases 2.5.0 added

#4 Updated by Lukas Zapletal 3 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by Tomer Brisker about 2 months ago

  • Category set to Development tools

Also available in: Atom PDF