Class: EM::Statsd

Inherits:
Statsd
  • Object
show all
Defined in:
lib/em/statsd.rb,
lib/em-statsd/version.rb

Defined Under Namespace

Classes: ConnectionWrapper

Constant Summary collapse

VERSION =
"1.0.0"

Instance Method Summary collapse

Constructor Details

#initialize(host, port = 8125) ⇒ Statsd

Returns a new instance of Statsd.



22
23
24
25
26
27
28
29
# File 'lib/em/statsd.rb', line 22

def initialize(host, port=8125)
  super
        # eventmachine forces us to listen on a UDP socket even
  # though we only
  # want to send, so we'll just give it a junk address
  em_connection = EM.open_datagram_socket("0.0.0.0", 0, EM::Connection)
  @socket = ConnectionWrapper.new(em_connection)
end