Class: Datadog::Statsd::UDPConnection
- Inherits:
-
Connection
- Object
- Connection
- Datadog::Statsd::UDPConnection
- Defined in:
- lib/datadog/statsd/udp_connection.rb
Constant Summary collapse
- DEFAULT_HOST =
'127.0.0.1'
- DEFAULT_PORT =
8125
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
StatsD host.
-
#port ⇒ Object
readonly
StatsD port.
Instance Method Summary collapse
-
#initialize(host, port, logger, telemetry) ⇒ UDPConnection
constructor
A new instance of UDPConnection.
Methods inherited from Connection
Constructor Details
#initialize(host, port, logger, telemetry) ⇒ UDPConnection
Returns a new instance of UDPConnection.
17 18 19 20 21 22 |
# File 'lib/datadog/statsd/udp_connection.rb', line 17 def initialize(host, port, logger, telemetry) super(telemetry) @host = host || ENV.fetch('DD_AGENT_HOST', DEFAULT_HOST) @port = port || ENV.fetch('DD_DOGSTATSD_PORT', DEFAULT_PORT).to_i @logger = logger end |
Instance Attribute Details
#host ⇒ Object (readonly)
StatsD host. Defaults to 127.0.0.1.
12 13 14 |
# File 'lib/datadog/statsd/udp_connection.rb', line 12 def host @host end |
#port ⇒ Object (readonly)
StatsD port. Defaults to 8125.
15 16 17 |
# File 'lib/datadog/statsd/udp_connection.rb', line 15 def port @port end |