Class: StatsD::Instrument::Backends::CaptureBackend

Inherits:
StatsD::Instrument::Backend show all
Defined in:
lib/statsd/instrument/backends/capture_backend.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCaptureBackend

Returns a new instance of CaptureBackend.



5
6
7
# File 'lib/statsd/instrument/backends/capture_backend.rb', line 5

def initialize
  reset
end

Instance Attribute Details

#collected_metricsObject (readonly)

Returns the value of attribute collected_metrics.



3
4
5
# File 'lib/statsd/instrument/backends/capture_backend.rb', line 3

def collected_metrics
  @collected_metrics
end

Instance Method Details

#collect_metric(metric) ⇒ Object



9
10
11
# File 'lib/statsd/instrument/backends/capture_backend.rb', line 9

def collect_metric(metric)
  @collected_metrics << metric
end

#resetObject



13
14
15
# File 'lib/statsd/instrument/backends/capture_backend.rb', line 13

def reset
  @collected_metrics = []
end