Class: FakeDatadogMetrics

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_metrics/testing/fake_datadog_metrics.rb

Overview

Mock statsd class to record data during the specs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFakeDatadogMetrics

Returns a new instance of FakeDatadogMetrics.



7
8
9
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 7

def initialize
  self.metrics = []
end

Instance Attribute Details

#metricsObject

Returns the value of attribute metrics.



3
4
5
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 3

def metrics
  @metrics
end

Instance Method Details

#count_with_tags(*arguments) ⇒ Object



23
24
25
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 23

def count_with_tags(*arguments)
  metrics << [:count, *arguments]
end

#gauge(*arguments) ⇒ Object



27
28
29
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 27

def gauge(*arguments)
  metrics << [:guage, *arguments]
end

#histogram_with_tags(*arguments) ⇒ Object



19
20
21
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 19

def histogram_with_tags(*arguments)
  metrics << [:histogram, *arguments]
end

#increment(*arguments) ⇒ Object



11
12
13
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 11

def increment(*arguments)
  metrics << [:increment, *arguments]
end

#increment_with_tags(*arguments) ⇒ Object



15
16
17
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 15

def increment_with_tags(*arguments)
  metrics << [:increment, *arguments]
end

#timing(*arguments) ⇒ Object



31
32
33
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 31

def timing(*arguments)
  metrics << [:timing, *arguments]
end

#timing_with_tags(*arguments) ⇒ Object



35
36
37
# File 'lib/datadog_metrics/testing/fake_datadog_metrics.rb', line 35

def timing_with_tags(*arguments)
  metrics << [:timing, *arguments]
end