Class: Datadog::Statsd::UDSConnection

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

Defined Under Namespace

Classes: BadSocketError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Connection

#reset_telemetry, #write

Constructor Details

#initialize(socket_path, **kwargs) ⇒ UDSConnection

Returns a new instance of UDSConnection.



13
14
15
16
17
18
# File 'lib/datadog/statsd/uds_connection.rb', line 13

def initialize(socket_path, **kwargs)
  super(**kwargs)

  @socket_path = socket_path
  @socket = nil
end

Instance Attribute Details

#socket_pathObject (readonly)

DogStatsd unix socket path



11
12
13
# File 'lib/datadog/statsd/uds_connection.rb', line 11

def socket_path
  @socket_path
end

Instance Method Details

#closeObject



20
21
22
23
# File 'lib/datadog/statsd/uds_connection.rb', line 20

def close
  @socket.close if @socket
  @socket = nil
end