Class: Airbrake::PerformanceNotifier
- Inherits:
-
Object
- Object
- Airbrake::PerformanceNotifier
show all
- Includes:
- Inspectable, Loggable
- Defined in:
- lib/airbrake-ruby/performance_notifier.rb
Overview
PerformanceNotifier aggregates performance data and periodically sends it to Airbrake.
rubocop:disable Metrics/ClassLength
Constant Summary
Constants included
from Inspectable
Inspectable::INSPECT_TEMPLATE
Instance Method Summary
collapse
Methods included from Loggable
#logger
#inspect, #pretty_print
Constructor Details
Returns a new instance of PerformanceNotifier.
Instance Method Details
#add_filter(filter = nil, &block) ⇒ Object
41
42
43
|
# File 'lib/airbrake-ruby/performance_notifier.rb', line 41
def add_filter(filter = nil, &block)
@filter_chain.add_filter(block_given? ? block : filter)
end
|
#close ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/airbrake-ruby/performance_notifier.rb', line 50
def close
@payload.synchronize do
@schedule_flush.kill if @schedule_flush
@sync_sender.close
@async_sender.close
end
end
|
#delete_filter(filter_class) ⇒ Object
46
47
48
|
# File 'lib/airbrake-ruby/performance_notifier.rb', line 46
def delete_filter(filter_class)
@filter_chain.delete_filter(filter_class)
end
|
#notify(metric) ⇒ Object
27
28
29
30
31
|
# File 'lib/airbrake-ruby/performance_notifier.rb', line 27
def notify(metric)
@payload.synchronize do
send_metric(metric, sync: false)
end
end
|
#notify_sync(metric) ⇒ Object
36
37
38
|
# File 'lib/airbrake-ruby/performance_notifier.rb', line 36
def notify_sync(metric)
send_metric(metric, sync: true).value
end
|