EM::Statsd
A drop-in extension/replacement to the statsd-ruby gem.
Installation
Add this line to your application's Gemfile:
gem 'em-statsd'
And then execute:
$ bundle
Or install it yourself as:
$ gem install em-statsd
Usage
Replace all occurances of the Statsd constant with EM::Statsd in your app, inside an EM::run block. It all works through the magic of adapter objects.
gem 'em-statsd'
require 'em/statsd'
EM::Statsd.logger = Logger.new(STDERR)
EM.run {
statsd = EM::Statsd.new('localhost', 12345);
EM.next_tick { statsd.increment("kittens") }
}
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request