Class: Camayoc::Handlers::Statsd
- Inherits:
-
Object
- Object
- Camayoc::Handlers::Statsd
- Includes:
- ThreadSafety
- Defined in:
- lib/camayoc/handlers/statsd.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
Returns the value of attribute namespace.
Instance Method Summary collapse
- #event(ev) ⇒ Object
-
#initialize(options = {}) ⇒ Statsd
constructor
A new instance of Statsd.
Methods included from ThreadSafety
#synchronize, #thread_safe=, #thread_safe?
Constructor Details
#initialize(options = {}) ⇒ Statsd
Returns a new instance of Statsd.
13 14 15 16 17 18 19 |
# File 'lib/camayoc/handlers/statsd.rb', line 13 def initialize(={}) self.namespace = [:namespace] @host = [:host] @port = [:port] @socket = UDPSocket.new self.thread_safe = Camayoc.thread_safe? end |
Instance Attribute Details
#namespace ⇒ Object
Returns the value of attribute namespace.
11 12 13 |
# File 'lib/camayoc/handlers/statsd.rb', line 11 def namespace @namespace end |
Instance Method Details
#event(ev) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/camayoc/handlers/statsd.rb', line 21 def event(ev) case ev.type when :timing then timing(ev) when :count then count(ev) else other(ev) end end |