class StatsD::Instrument::CaptureSink

@note This class is part of the new Client implementation that is intended

to become the new default in the next major release of this library.

Attributes

datagram_class[R]
datagrams[R]
parent[R]

Public Class Methods

new(parent:, datagram_class: StatsD::Instrument::Datagram) click to toggle source
# File lib/statsd/instrument/capture_sink.rb, line 10
def initialize(parent:, datagram_class: StatsD::Instrument::Datagram)
  @parent = parent
  @datagram_class = datagram_class
  @datagrams = []
end

Public Instance Methods

<<(datagram) click to toggle source
# File lib/statsd/instrument/capture_sink.rb, line 20
def <<(datagram)
  @datagrams << datagram_class.new(datagram)
  parent << datagram
  self
end
clear() click to toggle source
# File lib/statsd/instrument/capture_sink.rb, line 26
def clear
  @datagrams.clear
end
sample?(_sample_rate) click to toggle source
# File lib/statsd/instrument/capture_sink.rb, line 16
def sample?(_sample_rate)
  true
end