raindrops / 0.1.0
| Short description: | real-time stats for preforking Rack servers | |||||
|---|---|---|---|---|---|---|
| Category: | Library/Rack | |||||
| Status: | experimental | |||||
| Created: | 2010-04-08 00:54:32 GMT | |||||
| Last update: | 2010-04-08 00:54:32 GMT | |||||
| Owner: | raindrops hackers (Projects of this owner) | |||||
| Homepage: | http://raindrops.bogomips.org/ | |||||
| Download: | http://raindrops.bogomips.org/files | |||||
| License: | LGPL | |||||
| Dependency: |
|
|||||
| Description: | raindrops - real-time stats for preforking Rack serversRaindrops is a real time stats package to show statistics for Rack HTTP servers. It is designed for preforking servers such as Rainbows! and Unicorn, but should support any Rack HTTP server under Ruby 1.9, 1.8 and possibly Rubinius (untested) on platforms supporting POSIX shared memory and compiled with GCC (for atomic builtins). Raindrops includes a Struct-like Raindrops::Struct class that may be used standalone to create atomic counters shared across any number of forked processes under SMP. Features
Linux-only Extra Features!
Installraindrops requires GCC 4.x (or compatible) or later to support the atomic builtins (_sync{add,sub}_and_fetch()). Atomic operations on other compilers may be supported if there is demand. If you’re using a packaged Ruby distribution, make sure you have a C compiler and the matching Ruby development libraries and headers. If you use RubyGems:
gem install raindrops
Otherwise grab the latest tarball from: Unpack it, and run "ruby setup.rb" Usage (Rainbows!/Unicorn preload_app=false)If you’re using preload_app=false (the default) in your Rainbows!/Unicorn config file, you’ll need to create the global Stats object before forking.
require 'raindrops'
$stats ||= Raindrops::Middleware::Stats.new
In your Rack config.ru:
use Raindrops::Middleware, :stats => $stats
Usage (Rainbows!/Unicorn preload_app=true)If you’re using preload_app=true in your Rainbows!/Unicorn config file, just add the middleware to your stack: In your Rack config.ru:
use Raindrops::Middleware
Usage (Linux-extras)To get bound listener statistics under Linux, you need to specify the listener names for your server. You can even include listen sockets for other servers on the same machine. This can be handy for monitoring your nginx proxy as well. In your Rack config.ru, just pass the :listeners argument as an array of strings (along with any other arguments). You can specify any combination of TCP or Unix domain socket names:
use Raindrops::Middleware, :listeners => %w(0.0.0.0:80 /tmp/.sock)
See the tests/ and examples/ directory for more examples DevelopmentYou can get the latest source via git from the following locations: git://git.bogomips.org/raindrops.git git://repo.or.cz/raindrops.git (mirror) You may browse the code from the web and download the latest snapshot tarballs here:
Inline patches (from "git format-patch") to the mailing list are preferred because they allow code review and comments in the reply to the patch. We will adhere to mostly the same conventions for patch submissions as git itself. See the Documentation/SubmittingPatches document distributed with git on on patch submission guidelines to follow. Just don’t email the git mailing list or maintainer with raindrops patches. ContactAll feedback (bug reports, user/development discussion, patches, pull requests) go to the mailing list: raindrops@librelist.com |
|||||