Show HN: Rails Performance Help – Tracer Bullets
ninjasandrobots.com
ninjasandrobots.com
Literally, just add this initializer in your development.rb
config.after_initialize do
Bullet.enable = true
Bullet.alert = true
Bullet.bullet_logger = true
Bullet.console = true
Bullet.growl = true
Bullet.xmpp = { :account => 'bullets_account@jabber.org',
:password => 'bullets_password_for_jabber',
:receiver => 'your_account@jabber.org',
:show_online_status => true }
Bullet.rails_logger = true
Bullet.airbrake = true
end
https://github.com/flyerhzm/bullet>The Bullet gem is designed to help you increase your application's performance by reducing the number of queries it makes. It will watch your queries while you develop your application and notify you when you should add eager loading (N+1 queries), when you're using eager loading that isn't necessary and when you should use counter cache.
That said, https://github.com/justinweiss/request_profiler is as simple as a Gemfile line and request parameter, and gives you far deeper introspection of your code.
Rails instrumentation in particular allows plugging into controller actions, and things like the nunes gem hooks in even more places. But of course, you can also track timing info around blocks or methods quite easily on a ad-hoc basis.
Lots of this you get 'out-of-the-box' with newrelic (/pro), but this gives you even more flexibility and control.
I've written a quick and dirty port to Python, for anyone who'd like to take a look:
But also those usually only give you great data about SQL statements or things like this (Application code (in Document#transaction)) which doesn't say much, unless you add more New Relic instrumentation blocks in your code, which then requires a re-deploy.
Also, New Relic dev mode hasn't been updated in a long long time the last time I checked, and it was really buggy in showing you what line of code you were in.