Class: Yabeda::NewRelic::Adapter
- Inherits:
-
BaseAdapter
- Object
- BaseAdapter
- Yabeda::NewRelic::Adapter
- 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
-
#initialize ⇒ Adapter
constructor
A new instance of Adapter.
- #perform_counter_increment!(counter, tags, increment) ⇒ Object
- #perform_gauge_set!(metric, tags, value) ⇒ Object
- #perform_histogram_measure!(metric, tags, value) ⇒ Object
- #register_counter!(_metric) ⇒ Object
- #register_gauge!(_metric) ⇒ Object
- #register_histogram!(_metric) ⇒ Object
Constructor Details
#initialize ⇒ Adapter
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, , increment) ::NewRelic::Agent.increment_metric(build_name(counter, ), 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, , value) ::NewRelic::Agent.record_metric(build_name(metric, ), 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, , value) ::NewRelic::Agent.record_metric(build_name(metric, ), 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 |