Module: StatsD::Instrument::ConnectionBehavior

Included in:
UdpConnection, UdsConnection
Defined in:
lib/statsd/instrument/connection_behavior.rb

Instance Method Summary collapse

Instance Method Details

#closeObject



6
7
8
9
10
11
12
13
14
# File 'lib/statsd/instrument/connection_behavior.rb', line 6

def close
  @socket&.close
rescue IOError, SystemCallError => e
  StatsD.logger.debug do
    "[#{self.class.name}] Error closing socket: #{e.class}: #{e.message}"
  end
ensure
  @socket = nil
end

#send_buffer_sizeObject



16
17
18
19
20
21
22
# File 'lib/statsd/instrument/connection_behavior.rb', line 16

def send_buffer_size
  if socket
    send_buffer_size_from_socket(socket)
  else
    @max_packet_size
  end
end

#typeObject

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/statsd/instrument/connection_behavior.rb', line 24

def type
  raise NotImplementedError, "#{self.class} must implement #type"
end