pinba

Install

sudo gem install pinba

Rack middleware

#environment.rb - Rails

config.gem "pinba"
config.middleware.use "Pinba::Middleware"

# or

use Pinba::Middleware

Daemons

Pinba.start :script_name => name

Pinba.stop :status => status, :server_name => server_name, :document_size => size

Timers

Pinba.timer :layout => :index, :action => :generate_all do
  2 + 2 * 4
  sleep rand
end

or you can

Object.send :include, Pinba::Timer

and simply do

timer :layout => :index, :action => :generate_all do
  2 + 2 * 4
  sleep rand
end

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but

    bump version in a commit by itself we can ignore when we pull)
    
  • Send us a pull request. Bonus points for topic branches.

Copyright © 2009-2010 Andrew Rudenko <[email protected]>, Evgeniy Potapov <[email protected]>, ITSumma Ltd.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA