
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.