Skip to content
Browse files

Merge pull request #23 from oscardelben/master

Add basic usage
  • Loading branch information...
2 parents d99be81 + d7d53bb commit 93cda0545c21534d12fc9a4127c1d8a4373aa009 @reinh committed Oct 2, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 README.rdoc
View
17 README.rdoc
@@ -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>

0 comments on commit 93cda05

Please sign in to comment.
Something went wrong with that request. Please try again.