Class ProtocolHealthCheckStrategy

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

public class ProtocolHealthCheckStrategy extends AbstractStrategy
A strategy that aims to perform health check over a hostname on each protocol (HTTP, SNMP, IPMI, ...).

This aims to report the responsiveness of configured protocols on a resource. The health check is performed at the beginning of each data collection cycle, and a metric is generated for each protocol indicating whether it is responding or not.

  • Field Details

    • UP

      public static final Double UP
      Protocol up status value '1.0'
    • DOWN

      public static final Double DOWN
      Protocol down status value '0.0'
  • Constructor Details

    • ProtocolHealthCheckStrategy

      public ProtocolHealthCheckStrategy(@NonNull @NonNull TelemetryManager telemetryManager, @NonNull @NonNull Long strategyTime, @NonNull @NonNull ClientsExecutor clientsExecutor, @NonNull @NonNull ExtensionManager extensionManager)
      Constructs a new HealthCheckStrategy using the provided telemetry manager, strategy time, and clients executor.
      Parameters:
      telemetryManager - The telemetry manager responsible for managing telemetry-related operations.
      strategyTime - The time when the strategy is executed.
      clientsExecutor - The executor for managing clients used in the strategy.
      extensionManager - The extension manager where all the required extensions are handled.
  • Method Details

    • run

      public void run()
    • getStrategyTimeout

      public long getStrategyTimeout()
      Description copied from interface: IStrategy
      Get the timeout of the strategy.
      Specified by:
      getStrategyTimeout in interface IStrategy
      Overrides:
      getStrategyTimeout in class AbstractStrategy
      Returns:
      long value representing the timeout in seconds.
    • getStrategyTime

      public Long getStrategyTime()
      Description copied from interface: IStrategy
      Provide the current time from which the strategy starts.
      Returns:
      Long value representing the start time of the strategy.