The capture backend is used to capture the metrics that are collected, so you can run assertions on them.
@!attribute #collected_metrics [r]
@return [Array<StatsD::Instrument::Metric>] The list of metrics that were collected.
# File lib/statsd/instrument/backends/capture_backend.rb, line 12 def initialize reset end
Adds a metric to the ist of collected metrics. @param metric [StatsD::Instrument::Metric] The metric to collect. @return [void]
# File lib/statsd/instrument/backends/capture_backend.rb, line 19 def collect_metric(metric) @collected_metrics << metric end
Resets the list of collected metrics to an empty list. @return [void]
# File lib/statsd/instrument/backends/capture_backend.rb, line 25 def reset @collected_metrics = [] end