No commit activity in last 3 years
No release in over 3 years
StatsD driver for Alephant Logger gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.7
>= 0
~> 10.0
~> 3.1

Runtime

 Project Readme

Alephant::Logger::Statsd

Statsd driver for the alephant-logger gem, which consumes the statsd-ruby gem.

Installation

Add this line to your application's Gemfile:

gem 'alephant-logger-statsd'

And then execute:

$ bundle

Or install it yourself as:

$ gem install alephant-logger-statsd

Usage

Create an instance of the driver:

require "alephant/logger"
require "alephant/logger/statsd"

config = {
  :host      => "statsd.test.service.bbc.co.uk",
  :port      => 6452,
  :namespace => "test"
}

driver = Alephant::Logger::Statsd.new config
logger = Alephant::Logger.setup driver
logger.increment "foo.bar"

Note that a config is optional, if you leave any of the keys out then they will be replaced by the following:

{
  :host      => "localhost",
  :port      => 8125,
  :namespace => "statsd"
}

Then increment a custom metric, with a given key:

driver.increment 'front_page.response_time'

You can also increment the metric by a specific interval:

driver.increment('facebook.signups', 43)

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Create a new Pull Request.

Help

Please raise a new issue with the relevant label, or ping @revett.