From 1911673e67280802c49cf9eaa93fb15126d806fc Mon Sep 17 00:00:00 2001 From: Simon Perepelitsa Date: Fri, 4 Dec 2020 15:52:10 +0300 Subject: [PATCH] Add benchmark method that can be called from anywhere --- railties/CHANGELOG.md | 12 ++++++++++++ railties/lib/rails.rb | 1 + 2 files changed, 13 insertions(+) diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 06d69fd023..3e8bbccbfa 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -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. diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index 15037ac984..de7c21931a 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -25,6 +25,7 @@ end module Rails extend ActiveSupport::Autoload + extend ActiveSupport::Benchmarkable autoload :Info autoload :InfoController