Class: Yabeda::BaseAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/yabeda/base_adapter.rb

Overview

Base class for adapters to particular monitoring systems

Instance Method Summary collapse

Instance Method Details

#perform_counter_increment!(_counter, _tags, _increment) ⇒ Object

Raises:

  • (NotImplementedError)

19
20
21
# File 'lib/yabeda/base_adapter.rb', line 19

def perform_counter_increment!(_counter, _tags, _increment)
  raise NotImplementedError, "#{self.class} doesn't support incrementing counters"
end

#perform_gauge_set!(_metric, _tags, _value) ⇒ Object

Raises:

  • (NotImplementedError)

27
28
29
# File 'lib/yabeda/base_adapter.rb', line 27

def perform_gauge_set!(_metric, _tags, _value)
  raise NotImplementedError, "#{self.class} doesn't support setting gauges"
end

#perform_histogram_measure!(_metric, _tags, _value) ⇒ Object

Raises:

  • (NotImplementedError)

35
36
37
# File 'lib/yabeda/base_adapter.rb', line 35

def perform_histogram_measure!(_metric, _tags, _value)
  raise NotImplementedError, "#{self.class} doesn't support measuring histograms"
end

#register!(metric) ⇒ Object


6
7
8
9
10
11
12
13
# 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)
  else raise "#{metric.class} is unknown metric type"
  end
end

#register_counter!(_metric) ⇒ Object

Raises:

  • (NotImplementedError)

15
16
17
# File 'lib/yabeda/base_adapter.rb', line 15

def register_counter!(_metric)
  raise NotImplementedError, "#{self.class} doesn't support counters as metric type!"
end

#register_gauge!(_metric) ⇒ Object

Raises:

  • (NotImplementedError)

23
24
25
# File 'lib/yabeda/base_adapter.rb', line 23

def register_gauge!(_metric)
  raise NotImplementedError, "#{self.class} doesn't support gauges as metric type!"
end

#register_histogram!(_metric) ⇒ Object

Raises:

  • (NotImplementedError)

31
32
33
# File 'lib/yabeda/base_adapter.rb', line 31

def register_histogram!(_metric)
  raise NotImplementedError, "#{self.class} doesn't support histograms as metric type!"
end