Class: FakeDatadogMetrics
- Inherits:
-
Object
- Object
- FakeDatadogMetrics
- Defined in:
- lib/datadog_metrics/testing/fake_datadog_metrics.rb
Overview
Mock statsd class to record data during the specs.
Instance Attribute Summary collapse
-
#metrics ⇒ Object
Returns the value of attribute metrics.
Instance Method Summary collapse
- #count_with_tags(*arguments) ⇒ Object
- #gauge(*arguments) ⇒ Object
- #histogram_with_tags(*arguments) ⇒ Object
- #increment(*arguments) ⇒ Object
- #increment_with_tags(*arguments) ⇒ Object
-
#initialize ⇒ FakeDatadogMetrics
constructor
A new instance of FakeDatadogMetrics.
- #timing(*arguments) ⇒ Object
- #timing_with_tags(*arguments) ⇒ Object
Constructor Details
#initialize ⇒ FakeDatadogMetrics
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
#metrics ⇒ Object
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 (*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 (*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 (*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 (*arguments) metrics << [:timing, *arguments] end |