Class ProtocolHealthCheckStrategy
java.lang.Object
org.sentrysoftware.metricshub.engine.strategy.AbstractStrategy
org.sentrysoftware.metricshub.engine.strategy.collect.ProtocolHealthCheckStrategy
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final DoubleProtocol down status value '0.0'static final DoubleProtocol up status value '1.0'Fields inherited from class org.sentrysoftware.metricshub.engine.strategy.AbstractStrategy
CONNECTOR_ID_FORMAT -
Constructor Summary
ConstructorsConstructorDescriptionProtocolHealthCheckStrategy(@NonNull TelemetryManager telemetryManager, @NonNull Long strategyTime, @NonNull ClientsExecutor clientsExecutor, @NonNull ExtensionManager extensionManager) Constructs a newHealthCheckStrategyusing the provided telemetry manager, strategy time, and clients executor. -
Method Summary
Modifier and TypeMethodDescriptionProvide the current time from which the strategy starts.longGet the timeout of the strategy.voidrun()
-
Field Details
-
UP
Protocol up status value '1.0' -
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 newHealthCheckStrategyusing 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:IStrategyGet the timeout of the strategy.- Specified by:
getStrategyTimeoutin interfaceIStrategy- Overrides:
getStrategyTimeoutin classAbstractStrategy- Returns:
- long value representing the timeout in seconds.
-
getStrategyTime
Description copied from interface:IStrategyProvide the current time from which the strategy starts.- Returns:
Longvalue representing the start time of the strategy.
-