Class: Contrast::Agent::Reporting::Telemetry::Interface

Inherits:
Client::InterfaceBase show all
Defined in:
lib/contrast/agent/reporting/client/interface.rb

Overview

Interface to safely manage connections across threads.

Constant Summary collapse

URL =
'https://telemetry.ruby.contrastsecurity.com/'

Instance Method Summary collapse

Methods inherited from Client::InterfaceBase

#with_monitor

Instance Method Details

#connected?Boolean

Check to see if client exists and there is connection

Returns:

  • (Boolean)

    Boolean



104
105
106
107
108
109
110
# File 'lib/contrast/agent/reporting/client/interface.rb', line 104

def connected?
  with_monitor do
    return true if telemetry_client && telemetry_connection

    false
  end
end

#request_with_response(event) ⇒ Object

Starts telemetry request.



113
114
115
116
117
# File 'lib/contrast/agent/reporting/client/interface.rb', line 113

def request_with_response event
  with_monitor do
    telemetry_client.handle_response(telemetry_client.send_request(event, telemetry_connection))
  end
end