1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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 * Removed manifest.js and application.css in app/assets
folder when --skip-sprockets option passed as flag to rails. folder when --skip-sprockets option passed as flag to rails.

View file

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