Class: Instana::Backend::HostAgentReportingObserver
- Inherits:
-
Object
- Object
- Instana::Backend::HostAgentReportingObserver
- Defined in:
- lib/instana/backend/host_agent_reporting_observer.rb
Overview
Process which is responsible for reporting metrics and tracing to the local agent
Constant Summary collapse
- ENTITY_DATA_URL =
'/com.instana.plugin.ruby.%i'.freeze
- RESPONSE_DATA_URL =
'/com.instana.plugin.ruby/response.%i?messageId=%s'.freeze
- TRACES_DATA_URL =
"/com.instana.plugin.ruby/traces.%i".freeze
- TRACE_METRICS_URL =
"/tracermetrics".freeze
Instance Attribute Summary collapse
- #report_timer ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(client, discovery, logger: ::Instana.logger, timer_class: Concurrent::TimerTask, processor: ::Instana.processor) ⇒ HostAgentReportingObserver
constructor
A new instance of HostAgentReportingObserver.
- #update(time, _old_version, new_version) ⇒ Object
Constructor Details
#initialize(client, discovery, logger: ::Instana.logger, timer_class: Concurrent::TimerTask, processor: ::Instana.processor) ⇒ HostAgentReportingObserver
Returns a new instance of HostAgentReportingObserver.
18 19 20 21 22 23 24 25 |
# File 'lib/instana/backend/host_agent_reporting_observer.rb', line 18 def initialize(client, discovery, logger: ::Instana.logger, timer_class: Concurrent::TimerTask, processor: ::Instana.processor) @client = client @discovery = discovery @logger = logger @report_timer = timer_class.new(execution_interval: 1, run_now: true) { report_to_backend } @nonce = Time.now @processor = processor end |
Instance Attribute Details
#report_timer ⇒ Object (readonly)
14 15 16 |
# File 'lib/instana/backend/host_agent_reporting_observer.rb', line 14 def report_timer @report_timer end |
Instance Method Details
#update(time, _old_version, new_version) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/instana/backend/host_agent_reporting_observer.rb', line 27 def update(time, _old_version, new_version) return unless time > @nonce @nonce = time new_version.nil? ? @report_timer.shutdown : @report_timer.execute end |