Class: Yabeda::BaseAdapter
- Inherits:
-
Object
- Object
- Yabeda::BaseAdapter
- Defined in:
- lib/yabeda/base_adapter.rb
Overview
Base class for adapters to particular monitoring systems
Direct Known Subclasses
Instance Method Summary collapse
-
#debug! ⇒ Object
Hook to enable debug mode in adapters when it is enabled in Yabeda itself.
- #perform_counter_increment!(_counter, _tags, _increment) ⇒ Object
- #perform_gauge_set!(_metric, _tags, _value) ⇒ Object
- #perform_histogram_measure!(_metric, _tags, _value) ⇒ Object
- #perform_summary_observe!(_metric, _tags, _value) ⇒ Object
- #register!(metric) ⇒ Object
- #register_counter!(_metric) ⇒ Object
- #register_gauge!(_metric) ⇒ Object
- #register_histogram!(_metric) ⇒ Object
- #register_summary!(_metric) ⇒ Object
Instance Method Details
#debug! ⇒ Object
Hook to enable debug mode in adapters when it is enabled in Yabeda itself
49 |
# File 'lib/yabeda/base_adapter.rb', line 49 def debug!; end |
#perform_counter_increment!(_counter, _tags, _increment) ⇒ Object
20 21 22 |
# File 'lib/yabeda/base_adapter.rb', line 20 def perform_counter_increment!(_counter, , _increment) raise NotImplementedError, "#{self.class} doesn't support incrementing counters" end |
#perform_gauge_set!(_metric, _tags, _value) ⇒ Object
28 29 30 |
# File 'lib/yabeda/base_adapter.rb', line 28 def perform_gauge_set!(_metric, , _value) raise NotImplementedError, "#{self.class} doesn't support setting gauges" end |
#perform_histogram_measure!(_metric, _tags, _value) ⇒ Object
36 37 38 |
# File 'lib/yabeda/base_adapter.rb', line 36 def perform_histogram_measure!(_metric, , _value) raise NotImplementedError, "#{self.class} doesn't support measuring histograms" end |
#perform_summary_observe!(_metric, _tags, _value) ⇒ Object
44 45 46 |
# File 'lib/yabeda/base_adapter.rb', line 44 def perform_summary_observe!(_metric, , _value) raise NotImplementedError, "#{self.class} doesn't support observing summaries" end |
#register!(metric) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/yabeda/base_adapter.rb', line 6 def register!(metric) case metric when Counter then register_counter!(metric) when Gauge then register_gauge!(metric) when Histogram then register_histogram!(metric) when Summary then register_summary!(metric) else raise "#{metric.class} is unknown metric type" end end |
#register_counter!(_metric) ⇒ Object
16 17 18 |
# File 'lib/yabeda/base_adapter.rb', line 16 def register_counter!(_metric) raise NotImplementedError, "#{self.class} doesn't support counters as metric type!" end |
#register_gauge!(_metric) ⇒ Object
24 25 26 |
# File 'lib/yabeda/base_adapter.rb', line 24 def register_gauge!(_metric) raise NotImplementedError, "#{self.class} doesn't support gauges as metric type!" end |
#register_histogram!(_metric) ⇒ Object
32 33 34 |
# File 'lib/yabeda/base_adapter.rb', line 32 def register_histogram!(_metric) raise NotImplementedError, "#{self.class} doesn't support histograms as metric type!" end |
#register_summary!(_metric) ⇒ Object
40 41 42 |
# File 'lib/yabeda/base_adapter.rb', line 40 def register_summary!(_metric) raise NotImplementedError, "#{self.class} doesn't support summaries as metric type!" end |