Skip to content

JosephPatrickCabanilla/dogstatsd-ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dogstatsd-ruby

A client for DogStatsD, an extension of the StatsD metric server for Datadog.

Build Status

Quick Start Guide

First install the library:

gem install dogstatsd-ruby

Then start instrumenting your code:

# Load the dogstats module.
require 'statsd'

# Create a stats instance.
statsd = Statsd.new('localhost', 8125)

# Increment a counter.
statsd.increment('page.views')

# Record a gauge 50% of the time.
statsd.gauge('users.online', 123, :sample_rate=>0.5)

# Sample a histogram
statsd.histogram('file.upload.size', 1234)

# Time a block of code
statsd.time('page.render') do
  render_page('home.html')
end

# Tag a metric.
statsd.histogram('query.time', 10, :tags => ["version:1"])

Documentation

Full API documentation is available here.

Feedback

To suggest a feature, report a bug, or general discussion, head over here.

Change Log

  • 1.2.0
    • Added global tags.
    • Added ability to set namespace and tags from Statsd#initialize.
  • 1.1.0
    • Added sets metrics.
  • 1.0.0
    • Initial release.

Credits

dogstatsd-ruby is forked from Rien Henrichs original Statsd client.

Copyright (c) 2011 Rein Henrichs. See LICENSE.txt for further details.

About

A Ruby client for DogStatsd

Resources

License

Stars

Watchers

Forks

Packages

No packages published