
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
rails-middleware_timer
Advanced tools
A Rack middleware timer for Rails 4 and 5. Outputs results in miliseconds like so:
Started GET "/health" for 127.0.0.1 at 2016-12-15 23:39:19 +0000
ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by HealthController#show as HTML
Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
Sample message for Rack::Runtime ==> 22 ms
Sample message for ActionDispatch::Executor ==> 21 ms
Sample message for ActionDispatch::Static ==> 70 ms
Sample message for Rack::Sendfile ==> 70 ms
Put the following in your Gemfile:
gem 'rails-middleware_timer',
git: 'git://github.com/humzashah/rails-middleware_timer.git'
and bundle install
.
Then add the following to your environment.rb
file:
# config/environment.rb
# after: Rails.application.initialize!
Rails::MiddlewareTimer.time!
You can use a custom message format / method like so:
# config/initializers/rails-middleware_timer.rb
require 'rails/middleware_timer'
module Rails
module MiddlewareTimer
module Timer
module_function
def custom_output(class_name, time_taken)
puts "Sample message for #{class_name} ==> #{time_taken}"
end
end
end
end
FAQs
Unknown package
We found that rails-middleware_timer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.