Project

General

Profile

Actions

Bug #31715

closed

Print debugging timing information for initializer

Added by Lukas Zapletal almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Development tools
Target version:
-
Difficulty:
Triaged:
Yes
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 1 (0 open1 closed)

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

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
Actions #2

Updated by Lukas Zapletal almost 4 years ago

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

Updated by The Foreman Bot over 3 years ago

  • Fixed in Releases 2.5.0 added
Actions #4

Updated by Lukas Zapletal over 3 years ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by Tomer Brisker over 3 years ago

  • Category set to Development tools
Actions

Also available in: Atom PDF