Method: OpenC3::DecomMicroservice#initialize

Defined in:
lib/openc3/microservices/decom_microservice.rb

#initialize(*args) ⇒ DecomMicroservice

Returns a new instance of DecomMicroservice.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/openc3/microservices/decom_microservice.rb', line 32

def initialize(*args)
  super(*args)
  # Should only be one target, but there might be multiple decom microservices for a given target
  # First Decom microservice has no number in the name
  if @name =~ /__DECOM__/
    @topics << "#{@scope}__DECOMINTERFACE__{#{@target_names[0]}}"
  end
  Topic.update_topic_offsets(@topics)
  System.telemetry.limits_change_callback = method(:limits_change_callback)
  LimitsEventTopic.sync_system(scope: @scope)
  @error_count = 0
  @metric.set(name: 'decom_total', value: @count, type: 'counter')
  @metric.set(name: 'decom_error_total', value: @error_count, type: 'counter')
end