Class: Blabbermouth::Bystanders::NewRelic

Inherits:
Base
  • Object
show all
Defined in:
lib/blabbermouth/new_relic/bystander.rb

Instance Method Summary collapse

Instance Method Details

#count(key, total, *args) ⇒ Object



16
17
18
# File 'lib/blabbermouth/new_relic/bystander.rb', line 16

def count(key, total, *args)
  ::NewRelic::Agent.record_metric(key, total)
end

#error(key, e, *args) ⇒ Object



4
5
6
# File 'lib/blabbermouth/new_relic/bystander.rb', line 4

def error(key, e, *args)
  ::NewRelic::Agent.notice_error(e, (args.extract_options! || {}).merge(key: key))
end

#increment(key, by = 1, *args) ⇒ Object



12
13
14
# File 'lib/blabbermouth/new_relic/bystander.rb', line 12

def increment(key, by=1, *args)
  ::NewRelic::Agent.increment_metric(key, by)
end

#info(key, msg = nil, *args) ⇒ Object



8
9
10
# File 'lib/blabbermouth/new_relic/bystander.rb', line 8

def info(key, msg=nil, *args)
  ::NewRelic::Agent.record_custom_event(key, (args.extract_options! || {}).merge({message: msg}))
end

#time(key, duration = nil, *args) ⇒ Object



20
21
22
# File 'lib/blabbermouth/new_relic/bystander.rb', line 20

def time(key, duration=nil, *args)
  ::NewRelic::Agent.record_custom_event(key, (args.extract_options! || {}).merge({duration: duration}))
end