April 22, 2009
Rack::Bug debugging toolbar in four minutes
Here’s a quick screencast demonstrating Rack::Bug, a new Rack middleware for inspecting requests to any Rack-compatible web application.
Download the screencast (12 MB, 4:00)
The source is on GitHub. It ships with nine panels:
- Rails Info
- Resource Usage
- Rack Env
- SQL
- AR Objects
- Memcached
- Templates
- Log
- Memory Usage
./script/plugin install git://github.com/brynary/rack-bug.git
1 2 3 4 5 6 7 |
# config/initializers/middleware.rb require "rack/bug" ActionController::Dispatcher.middleware.use Rack::Bug, :ip_masks => [IPAddr.new("127.0.0.1")], :secret_key => "epT5uCIchlsHCeR9dloOeAPG66PtHd9K8l0q9avitiaA/KUrY7DE52hD4yWY+8z1", :password => "rack-bug-secret" |
April 22, 2009 at 4:07 PM
Hell. Yeah.
April 22, 2009 at 4:46 PM
Impressive work Bryan!
April 22, 2009 at 8:04 PM
That’s real hot.
April 23, 2009 at 1:20 AM
Wow. Definitely one of the coolest uses of Rack yet.
April 23, 2009 at 3:51 AM
Nice work! Would love to see this as a gem with ~/.rack-bug settings (for multiple apps)
April 23, 2009 at 6:21 PM
Nice! One small tip. Calling Rails::Info.properties has an unfortunate side effect in defining the ActiveRecord module. A lot of Rails code checks defined? ActiveRecord (including your own!) to determine whether ActiveRecord is loaded, so if the app does not include the ActiveRecord framework, you can start seeing errors after invoking Rails::Info.properties.
It seems like this should be fixed in Rails by calling defined? ActiveRecord::Base but I’m not 100% sure.
May 12, 2009 at 9:51 AM
”...a new Rack middleware for inspecting requests to any Rack-compatible web application”. How does one use this with something other than Rails and AR (Datamapper)?
May 13, 2009 at 5:54 AM
Nice work, this will be very useful for many developers as they can now easily track down bottlenecks in their apps
But… That green, its just awful
cheers
May 17, 2009 at 4:58 PM
Blog added to my favorites! :-)
May 26, 2009 at 9:48 PM
Bryan, thanks a lot. This is VERY helpful. By the way, for Windows users who are having issues with installing plugins from Github, see my post: http://rails.webintellix.com/index.php/2009/05/installing-rails-plugins-from-github-on-windows/
July 05, 2009 at 6:08 PM
Hello,
am I the only one getting errors after installing this plugin? it seems very promising indeed but I can’t use it.
I installed via ./script/plugin install git://github.com/brynary/rack-bug.git and everything went fine, so I added the file middleware.rb and filled it with the code you gave us; then when I try to start the server I get a lot of errors, if I delete the file middleware.rb the server is working again.
can someone please help me?
Thanks in advance Gnagno
July 06, 2009 at 6:46 AM
Sorry,
I’ve found the problem is that I was using rails 2.2, is there a version of this fantastic midleware for rails 2.2 ?
thanks Gnagno
July 10, 2009 at 9:36 AM
hi, i just installed (in rails 2.3.2) and getting uninitialized constant Digest::SHA1 ??