Class: ScoutApm::ErrorService::Notifier
- Inherits:
-
Object
- Object
- ScoutApm::ErrorService::Notifier
- Defined in:
- lib/scout_apm/error_service/notifier.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
Instance Method Summary collapse
-
#initialize(context) ⇒ Notifier
constructor
A new instance of Notifier.
- #ship ⇒ Object
Constructor Details
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'lib/scout_apm/error_service/notifier.rb', line 4 def context @context end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
5 6 7 |
# File 'lib/scout_apm/error_service/notifier.rb', line 5 def reporter @reporter end |
Instance Method Details
#ship ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/scout_apm/error_service/notifier.rb', line 12 def ship error_records = context.error_buffer.get_and_reset_error_records if error_records.any? payload = ScoutApm::ErrorService::Payload.new(context, error_records) reporter.report( payload.serialize, default_headers.merge("X-Error-Count" => error_records.length.to_s) ) end end |