Class: Contrast::Agent::Reporting::Client::Interface
- Inherits:
-
InterfaceBase
- Object
- InterfaceBase
- Contrast::Agent::Reporting::Client::Interface
- Defined in:
- lib/contrast/agent/reporting/client/interface.rb
Overview
Interface to safely manage connections across threads.
Instance Method Summary collapse
-
#connected? ⇒ Boolean
Check to see if client exists and there is connection.
-
#handle_resend(event) ⇒ Object
Retry once than discard the event.
- #headers ⇒ Object
-
#resending? ⇒ Boolean?
Check to see if event need to be resend.
-
#response_handler ⇒ Contrast::Agent::Reporting::ResponseHandler
Response_handler.
- #send_event(event) ⇒ Net::HTTPResponse
-
#sleep? ⇒ Boolean
return [Boolean].
-
#startup ⇒ Object
Execute startup routine and.
-
#startup_messages_sent? ⇒ Boolean
Check to see if statup connections are sent or not.
- #status ⇒ Object
-
#timeout ⇒ Object
Return timeout in ms.
Methods inherited from InterfaceBase
Instance Method Details
#connected? ⇒ Boolean
Check to see if client exists and there is connection
41 42 43 44 45 46 47 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 41 def connected? with_monitor do return true if reporter_client && reporting_connection false end end |
#handle_resend(event) ⇒ Object
Retry once than discard the event. This is trigger on too many events of same kind error.
32 33 34 35 36 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 32 def handle_resend event with_monitor do reporter_client.handle_resend(event, reporting_connection) end end |
#headers ⇒ Object
67 68 69 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 67 def headers with_monitor { reporter_client.headers } end |
#resending? ⇒ Boolean?
Check to see if event need to be resend
57 58 59 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 57 def resending? with_monitor { reporter_client.mode.status == reporter_client.mode.resending } end |
#response_handler ⇒ Contrast::Agent::Reporting::ResponseHandler
Response_handler
74 75 76 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 74 def response_handler with_monitor { reporter_client.response_handler } end |
#send_event(event) ⇒ Net::HTTPResponse
19 20 21 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 19 def send_event event with_monitor { reporter_client.send_event(event, reporting_connection) } end |
#sleep? ⇒ Boolean
return [Boolean]
24 25 26 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 24 def sleep? with_monitor { reporter_client.sleep? } end |
#startup ⇒ Object
Execute startup routine and
13 14 15 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 13 def startup with_monitor { reporter_client.startup!(reporting_connection) } end |
#startup_messages_sent? ⇒ Boolean
Check to see if statup connections are sent or not
50 51 52 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 50 def with_monitor { reporter_client.status. } end |
#status ⇒ Object
78 79 80 |
# File 'lib/contrast/agent/reporting/client/interface.rb', line 78 def status with_monitor { reporter_client.status } end |