-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds Thread Metrics RCA Signed-off-by: Surya Sashank Nistala <[email protected]> * Return healthy flow unit from ThreadMetricsRca Signed-off-by: Surya Sashank Nistala <[email protected]>
- Loading branch information
Showing
10 changed files
with
637 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/main/java/org/opensearch/performanceanalyzer/rca/store/rca/hot_node/ThreadAnalysis.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.performanceanalyzer.rca.store.rca.hot_node; | ||
|
||
|
||
import java.util.function.Predicate; | ||
import org.opensearch.performanceanalyzer.rca.framework.metrics.ReaderMetrics; | ||
|
||
public class ThreadAnalysis { | ||
private final ThreadMetricsSlidingWindow blockedTimeWindow; | ||
|
||
private final ThreadMetricsSlidingWindow waitedTimeWindow; | ||
private final Predicate<String> typeFilter; | ||
private final ReaderMetrics blockedThreadCountMetric, | ||
waitedThreadCountMetric, | ||
maxBlockedTimeMetric, | ||
maxWaitedTimeMetric; | ||
|
||
public ThreadAnalysis( | ||
Predicate<String> typeFilter, | ||
ReaderMetrics blockedThreadCountMetric, | ||
ReaderMetrics waitedThreadCount, | ||
ReaderMetrics maxBlockedTime, | ||
ReaderMetrics maxWaitedTimeMetric) { | ||
this.typeFilter = typeFilter; | ||
this.blockedThreadCountMetric = blockedThreadCountMetric; | ||
this.waitedThreadCountMetric = waitedThreadCount; | ||
this.maxBlockedTimeMetric = maxBlockedTime; | ||
this.maxWaitedTimeMetric = maxWaitedTimeMetric; | ||
blockedTimeWindow = new ThreadMetricsSlidingWindow(); | ||
waitedTimeWindow = new ThreadMetricsSlidingWindow(); | ||
} | ||
|
||
public ThreadMetricsSlidingWindow getBlockedTimeWindow() { | ||
return blockedTimeWindow; | ||
} | ||
|
||
public ThreadMetricsSlidingWindow getWaitedTimeWindow() { | ||
return waitedTimeWindow; | ||
} | ||
|
||
public Predicate<String> getTypeFilter() { | ||
return typeFilter; | ||
} | ||
|
||
public ReaderMetrics getBlockedThreadCountMetric() { | ||
return blockedThreadCountMetric; | ||
} | ||
|
||
public ReaderMetrics getWaitedThreadCountMetric() { | ||
return waitedThreadCountMetric; | ||
} | ||
|
||
public ReaderMetrics getMaxBlockedTimeMetric() { | ||
return maxBlockedTimeMetric; | ||
} | ||
|
||
public ReaderMetrics getMaxWaitedTimeMetric() { | ||
return maxWaitedTimeMetric; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/org/opensearch/performanceanalyzer/rca/store/rca/hot_node/ThreadMetric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.performanceanalyzer.rca.store.rca.hot_node; | ||
|
||
public class ThreadMetric { | ||
private final String name; | ||
private final double value; | ||
private final long timeStamp; | ||
|
||
private final String operation; | ||
|
||
public ThreadMetric(String threadName, double val, long timeStamp, String operation) { | ||
this.name = threadName; | ||
this.value = val; | ||
this.timeStamp = timeStamp; | ||
this.operation = operation; | ||
} | ||
|
||
public String getOperation() { | ||
return operation; | ||
} | ||
|
||
public long getTimeStamp() { | ||
return timeStamp; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public double getValue() { | ||
return value; | ||
} | ||
} |
Oops, something went wrong.