https://github.com/basecamp/action_profiler
Profile Rails requests on a live app
https://github.com/basecamp/action_profiler
Last synced: 11 months ago
JSON representation
Profile Rails requests on a live app
- Host: GitHub
- URL: https://github.com/basecamp/action_profiler
- Owner: basecamp
- License: mit
- Created: 2009-01-29T22:02:17.000Z (over 17 years ago)
- Default Branch: master
- Last Pushed: 2022-04-15T07:36:44.000Z (about 4 years ago)
- Last Synced: 2025-07-18T05:34:42.131Z (11 months ago)
- Language: Ruby
- Homepage: http://37signals.com
- Size: 237 KB
- Stars: 76
- Watchers: 16
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: MIT-LICENSE
Awesome Lists containing this project
README
= Action Profiler
`gem install ruby-prof` then add ?profile=process_time to any URL to profile
the page load and download a calltree file. Open it with kcachegrind.
Add an around_filter :action_profiler to ApplicationController:
around_filter :action_profiler unless Rails.env.production?
Enable live profiling in production accessible to specific IP addresses:
ALLOWED_IPS = ['127.0.0.1', '1.2.3.4']
around_filter :action_profiler, :if =>
lambda { |c| ALLOWED_IPS.include?(c.request.remote_ip) }
If you're using Ruby Enterprise Edition or a patched Ruby 1.8, you can profile
memory and object allocation also: ?profile=memory or allocations.
This plugin uses an around_filter to profile the controller action only.
Rack::Profiler, part of rack-contrib, can profile the entire Rails request.
== License
Released under the MIT license, copyright (c) 2007-2009 37signals, LLC.