Class: Hallmonitor::Outputters::NewRelic
- Inherits:
-
Hallmonitor::Outputter
- Object
- Hallmonitor::Outputter
- Hallmonitor::Outputters::NewRelic
- Defined in:
- lib/hallmonitor/outputters/new_relic.rb
Overview
Outputs events to NewRelic using their custom metrics API
Instance Attribute Summary
Attributes inherited from Hallmonitor::Outputter
Instance Method Summary collapse
-
#initialize(prefix = '') ⇒ NewRelic
constructor
Initializes a new instance.
- #process(event) ⇒ Object
Constructor Details
#initialize(prefix = '') ⇒ NewRelic
Initializes a new instance
8 9 10 11 12 13 |
# File 'lib/hallmonitor/outputters/new_relic.rb', line 8 def initialize(prefix = '') unless defined?(::NewRelic::Agent) fail 'In order to use NewRelic, new_relic gem must be installed' end super(prefix) end |
Instance Method Details
#process(event) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/hallmonitor/outputters/new_relic.rb', line 15 def process(event) if event.is_a?(Hallmonitor::TimedEvent) process_timed_event(event) elsif event.is_a?(Hallmonitor::GaugeEvent) process_gauge_event(event) else process_event(event) end end |