Skip to content

Commit

Permalink
Merge pull request #23 from oscardelben/master
Browse files Browse the repository at this point in the history
Add basic usage
  • Loading branch information
reinh committed Oct 2, 2012
2 parents d99be81 + d7d53bb commit 93cda05
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ A Ruby client for {StatsD}[https://github.com/etsy/statsd]
Bundler:
gem "statsd-ruby", :require => "statsd"

= Basic Usage

# Set up a global Statsd client for a server on localhost:9125
$statsd = Statsd.new 'localhost', 8125

# Send some stats
$statsd.increment 'garets'
$statsd.timing 'glork', 320
$statsd.gauge 'bork', 100

# Use {#time} to time the execution of a block
$statsd.time('account.activate') { @account.activate! }

# Create a namespaced statsd client and increment 'account.activate'
statsd = Statsd.new('localhost').tap{|sd| sd.namespace = 'account'}
statsd.increment 'activate'

= Testing

Run the specs with <tt>rake spec</tt>
Expand Down

0 comments on commit 93cda05

Please sign in to comment.