lib/contrast/agent/thread_watcher.rb in contrast-agent-6.1.2 vs lib/contrast/agent/thread_watcher.rb in contrast-agent-6.2.0
- old
+ new
@@ -30,14 +30,12 @@
@heapdump_util = Contrast::Utils::HeapDumpUtil.new
unless ::Contrast::CONTRAST_SERVICE.unnecessary?
@heartbeat = Contrast::Agent::ServiceHeartbeat.new
@messaging_queue = Contrast::Api::Communication::MessagingQueue.new
end
- if Contrast::Agent::Reporter.enabled?
- @reporter = Contrast::Agent::Reporter.new
- @reporter_heartbeat = Contrast::Agent::ReporterHeartbeat.new
- end
+ @reporter = Contrast::Agent::Reporter.new
+ @reporter_heartbeat = Contrast::Agent::ReporterHeartbeat.new if Contrast::Agent::Reporter.enabled?
@telemetry = Contrast::Agent::Telemetry::Base.new if Contrast::Agent::Telemetry::Base.enabled?
end
# @return [Hash, nil] map of process to thread startup status
def startup!
@@ -49,12 +47,13 @@
@pids[Process.pid] = messaging_status && heartbeat_status
if Contrast::Agent::Telemetry::Base.enabled?
telemetry_status = init_thread(telemetry_queue)
@pids[Process.pid] = @pids[Process.pid] && telemetry_status
end
+ reporter_status = init_thread(reporter)
+
return @pids unless Contrast::Agent::Reporter.enabled?
- reporter_status = init_thread(reporter)
reporter_heartbeat_status = init_thread(reporter_heartbeat)
@pids[Process.pid] = @pids[Process.pid] && reporter_status && reporter_heartbeat_status
@pids
end