Class: Yabeda::NewRelic::Adapter

Inherits:
BaseAdapter
  • Object
show all
Defined in:
lib/yabeda/newrelic/adapter.rb

Overview

NewRelic adapter. Sends yabeda metrics as custom metrics to NewRelic. See docs.newrelic.com/docs/agents/ruby-agent/api-guides/ruby-custom-metrics

Instance Method Summary collapse

Constructor Details

#initializeAdapter

Returns a new instance of Adapter.



35
36
37
38
# File 'lib/yabeda/newrelic/adapter.rb', line 35

def initialize(*)
  super
  ::NewRelic::Agent.add_instrumentation(File.join(__dir__, "configure.rb"))
end

Instance Method Details

#perform_counter_increment!(counter, tags, increment) ⇒ Object



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

def perform_counter_increment!(counter, tags, increment)
  ::NewRelic::Agent.increment_metric(build_name(counter, tags), increment)
end

#perform_gauge_set!(metric, tags, value) ⇒ Object



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

def perform_gauge_set!(metric, tags, value)
  ::NewRelic::Agent.record_metric(build_name(metric, tags), value)
end

#perform_histogram_measure!(metric, tags, value) ⇒ Object



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

def perform_histogram_measure!(metric, tags, value)
  ::NewRelic::Agent.record_metric(build_name(metric, tags), value)
end

#register_counter!(_metric) ⇒ Object



11
12
13
# File 'lib/yabeda/newrelic/adapter.rb', line 11

def register_counter!(_metric)
  # Do nothing. NewRelic don't need to register metrics
end

#register_gauge!(_metric) ⇒ Object



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

def register_gauge!(_metric)
  # Do nothing. NewRelic don't need to register metrics
end

#register_histogram!(_metric) ⇒ Object



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

def register_histogram!(_metric)
  # Do nothing. NewRelic don't need to register metrics
end