Class: Yabeda::BaseAdapter

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

Overview

Base class for adapters to particular monitoring systems

Direct Known Subclasses

TestAdapter

Instance Method Summary collapse

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

Raises:

  • (NotImplementedError)


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

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)


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

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)


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

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

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

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/yabeda/base_adapter.rb', line 44

def perform_summary_observe!(_metric, _tags, _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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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