Class: Roundtrip::Metrics::Statsd
- Inherits:
-
Object
- Object
- Roundtrip::Metrics::Statsd
- Defined in:
- lib/roundtrip/metrics/statsd.rb
Instance Method Summary collapse
-
#initialize(opts = {:statsd => {:host => 'localhost', :port => 8125}}) ⇒ Statsd
constructor
A new instance of Statsd.
- #time(route, event, time) ⇒ Object
Constructor Details
#initialize(opts = {:statsd => {:host => 'localhost', :port => 8125}}) ⇒ Statsd
Returns a new instance of Statsd.
5 6 7 |
# File 'lib/roundtrip/metrics/statsd.rb', line 5 def initialize(opts={:statsd => {:host => 'localhost', :port => 8125}}) @statsd =opts[:statsd][:connection] || ::Statsd.new(opts[:statsd][:host], opts[:statsd][:port]) end |
Instance Method Details
#time(route, event, time) ⇒ Object
9 10 11 |
# File 'lib/roundtrip/metrics/statsd.rb', line 9 def time(route, event, time) @statsd.timing("#{route}.#{event}", time) end |