0.0
No commit activity in last 3 years
No release in over 3 years
An Event Machine wrapper around Ruby Statsd client.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0

Runtime

 Project Readme

EventMachine Statsd

Build Status Coverage Status

EM::Statsd is a simple async wrapper around the ruby Statsd client. It uses EventMachine Connection class to push data around.

It is written for statsd-ruby v1.3.0

For older versions of statsd-ruby use old wrapper

Getting started

  1. Add em-statsd-ruby to your Gemfile and bundle install:

    gem 'em-statsd-ruby'
  2. Require it in code and use:

    require 'eventmachine'
    require 'em-statsd-ruby'
        
    EM.run do
      statsd = EM::Statsd.new('127.0.0.1', 8125)
      statsd.increment 'daddy'
    end
  3. If you prefer tcp:

    statsd = EM::Statsd.new('127.0.0.1', 8125, :tcp)
  4. It supports batch too:

    EM.run do
      statsd = EM::Statsd.new('127.0.0.1', 8125)
      statsd.batch do |s|
        s.increment 'daddy'
        s.count 'kitty', 5
      end
    end

or

```ruby 
EM.run do
  statsd = EM::Batch(EM::Statsd.new('127.0.0.1', 8125))
  statsd.increment 'daddy'
  statsd.count 'kitty', 5
end
``` 

Copyright

Copyright (c) Valery Mayatsky. See LICENSE for details.