Skip to content

Commit

Permalink
Issue #203: Refactor-Extensions-code-to-check-protocol-efficiently
Browse files Browse the repository at this point in the history
Modify ProtocolHealthCheckStrategy
  • Loading branch information
SafaeAJ committed Jun 4, 2024
1 parent 0681744 commit ad04d4d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ public void run() {
protocolExtensions.forEach(protocolExtension -> {
Optional<Boolean> protocolCheckResult = protocolExtension.checkProtocol(telemetryManager);

double metricValue;
if (!protocolCheckResult.isPresent()) {
metricValue = DOWN;
return;
} else {
metricValue = protocolCheckResult.get() ? UP : DOWN;
}
Expand All @@ -95,7 +94,7 @@ public void run() {
.collectNumberMetric(
telemetryManager.getEndpointHostMonitor(),
"metricshub.host.up{protocol=\"" + protocolExtension.getIdentifier() + "\"}",
metricValue,
protocolCheckResult.get() ? UP : DOWN,
telemetryManager.getStrategyTime()
);
// CHECKSTYLE:OFF
Expand Down

0 comments on commit ad04d4d

Please sign in to comment.