Class: Datadog::Core::Configuration::Components::NullCloudwise

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/configuration/components.rb

Overview

Null object pattern for when Cloudwise fails to load

Defined Under Namespace

Classes: MockProbeState

Instance Method Summary collapse

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


112
113
114
# File 'lib/datadog/core/configuration/components.rb', line 112

def enabled?
  false
end

#initialize_async(&block) ⇒ Object



116
117
118
119
120
121
# File 'lib/datadog/core/configuration/components.rb', line 116

def initialize_async(&block)
  # If Cloudwise is disabled/failed, immediately call the callback
  # to allow Datadog components to initialize normally
  block&.call
  true
end

#probe_stateObject



131
132
133
134
# File 'lib/datadog/core/configuration/components.rb', line 131

def probe_state
  # Return a mock probe state that always allows collection
  @probe_state ||= MockProbeState.new
end

#startObject



123
124
125
# File 'lib/datadog/core/configuration/components.rb', line 123

def start
  # No-op
end

#stopObject



127
128
129
# File 'lib/datadog/core/configuration/components.rb', line 127

def stop
  # No-op
end