Add benchmark method that can be called from anywhere

This commit is contained in:
Simon Perepelitsa 2020-12-04 15:52:10 +03:00
parent 9b6008924d
commit 1911673e67
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,15 @@
* Add benchmark method that can be called from anywhere.
This method is used as a quick way to measure & log the speed of some code.
However, it was previously available only in specific contexts, mainly views and controllers.
The new Rails.benchmark can be used in the rest of your app: services, API wrappers, models, etc.
def test
Rails.benchmark("test") { ... }
end
*Simon Perepelitsa*
* Removed manifest.js and application.css in app/assets
folder when --skip-sprockets option passed as flag to rails.

View File

@ -25,6 +25,7 @@ end
module Rails
extend ActiveSupport::Autoload
extend ActiveSupport::Benchmarkable
autoload :Info
autoload :InfoController