java.lang.Object
org.sentrysoftware.metricshub.engine.strategy.AbstractStrategy
org.sentrysoftware.metricshub.engine.strategy.detection.DetectionStrategy
All Implemented Interfaces:
Runnable, IStrategy

public class DetectionStrategy extends AbstractStrategy
The DetectionStrategy class represents the strategy for detecting and creating monitors based on the configuration and connector detection results. It is responsible for running connector detection, creating monitors for the detected connectors, and updating the status of configured connectors.

The class extends AbstractStrategy and implements the detection and creation logic for monitors based on connector detection results. It uses the TelemetryManager to manage monitors and metrics associated with connectors.

  • Constructor Details

    • DetectionStrategy

      public DetectionStrategy(@NonNull @NonNull TelemetryManager telemetryManager, @NonNull @NonNull Long strategyTime, @NonNull @NonNull ClientsExecutor clientsExecutor, @NonNull @NonNull ExtensionManager extensionManager)
      Builder for constructing instances of DetectionStrategy.
      Parameters:
      telemetryManager - The telemetry manager for managing monitors and metrics.
      strategyTime - The time at which the detection strategy is executed.
      clientsExecutor - The executor for running connector clients.
      extensionManager - The extension manager where all the required extensions are handled.
  • Method Details

    • run

      public void run()
    • createConnectorMonitor

      public void createConnectorMonitor(ConnectorTestResult connectorTestResult)
      This method creates a connector monitor in TelemetryManager for the given ConnectorTestResult instance
      Parameters:
      connectorTestResult - The result of testing criteria for a connector during the detection process