Class: Datadog::Statsd::UDPConnection

Inherits:
Connection
  • Object
show all
Defined in:
lib/datadog/statsd.rb

Constant Summary

Constants inherited from Connection

Connection::DEFAULT_HOST, Connection::DEFAULT_PORT

Instance Attribute Summary

Attributes inherited from Connection

#host, #port, #socket_path

Instance Method Summary collapse

Methods inherited from Connection

#close, #write

Constructor Details

#initialize(host, port, logger) ⇒ UDPConnection

Returns a new instance of UDPConnection.



70
71
72
73
74
# File 'lib/datadog/statsd.rb', line 70

def initialize(host, port, logger)
  @host = host || ENV.fetch('DD_AGENT_HOST', nil) || DEFAULT_HOST
  @port = port || ENV.fetch('DD_DOGSTATSD_PORT', nil) || DEFAULT_PORT
  @logger = logger
end