Created
July 31, 2015 18:13
-
-
Save blurredbits/db05490c5f9bcd09531a to your computer and use it in GitHub Desktop.
Revisions
-
blurredbits created this gist
Jul 31, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ require 'statsd-ruby' statsd = Statsd.new('localhost', 8125) # Single call to statsd timer. statsd.time("timer_data") do timer_data = 1 + Random.rand(6) puts timer_data sleep timer_data end # Multiple calls to statsd timer. 10.times do statsd.time("timer_data") do timer_data = 1 + Random.rand(6) puts timer_data sleep timer_data end end # Statsd Timer call without a code block 10.times do fake_data = 1 + Random.rand(6) puts fake_data statsd.timing "fake_timer_data", fake_data end