Skip to content

Commit 9bab310

Browse files
author
Bhumika Sharma
committed
Fix: removes increment counter method
Signed-off-by: Bhumika Sharma <[email protected]>
1 parent 60605ad commit 9bab310

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363
import java.util.function.LongSupplier;
6464
import java.util.stream.Collectors;
6565

66-
import static org.opensearch.monitor.StatusInfo.Status.HEALTHY;
67-
import static org.opensearch.monitor.StatusInfo.Status.UNHEALTHY;
66+
import static org.opensearch.monitor.StatusInfo.Status.*;
6867

6968
/**
7069
* Runs periodically and attempts to create a temp file to see if the filesystem is writable. If not then it marks the
@@ -226,14 +225,10 @@ public void run() {
226225
private void emitMetric() {
227226
StatusInfo healthStatus = getHealth();
228227
if (healthStatus.getStatus() == UNHEALTHY) {
229-
incrementCounter(fsHealthFailCounter, 1.0);
228+
fsHealthFailCounter.add(1.0);
230229
}
231230
}
232231

233-
private void incrementCounter(Counter counter, Double value) {
234-
counter.add(value);
235-
}
236-
237232
private void monitorFSHealth() {
238233
Set<Path> currentUnhealthyPaths = null;
239234
Path[] paths = null;

0 commit comments

Comments
 (0)