From d19ad9c7c66a578a2b9b3076070f07082d4e0b9d Mon Sep 17 00:00:00 2001 From: Karthik Kumarguru Date: Fri, 23 Oct 2020 14:23:36 -0700 Subject: [PATCH] Add more RCA metrics --- .../rca/store/rca/jvmsizing/HighOldGenOccupancyRca.java | 2 ++ .../rca/store/rca/jvmsizing/OldGenContendedRca.java | 3 +++ .../rca/store/rca/jvmsizing/OldGenReclamationRca.java | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/HighOldGenOccupancyRca.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/HighOldGenOccupancyRca.java index 3bfa7fe04..7705fee37 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/HighOldGenOccupancyRca.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/HighOldGenOccupancyRca.java @@ -36,6 +36,7 @@ public class HighOldGenOccupancyRca extends OldGenRca> { private static final Logger LOG = LogManager.getLogger(HighOldGenOccupancyRca.class); + private static final String OLD_GEN_OVER_OCCUPIED_METRIC = "OldGenOverOccupied"; private static final long EVAL_INTERVAL_IN_S = 5; private static final int B_TO_MB = 1024 * 1024; @@ -107,6 +108,7 @@ private ResourceFlowUnit evaluateAndEmit() { (double)heapUtilizationThreshold, averageUtilizationPercentage, (int)rcaEvaluationIntervalInS); if (averageUtilizationPercentage >= heapUtilizationThreshold) { + StatsCollector.instance().logMetric(OLD_GEN_OVER_OCCUPIED_METRIC); context = new ResourceContext(State.UNHEALTHY); } this.previousSummary = summary; diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/OldGenContendedRca.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/OldGenContendedRca.java index 46e90fa92..118dc36e5 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/OldGenContendedRca.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/OldGenContendedRca.java @@ -17,6 +17,7 @@ import static com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.configs.OldGenContendedRcaConfig.DEFAULT_MIN_TOTAL_MEMORY_IN_GB; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.StatsCollector; import com.amazon.opendistro.elasticsearch.performanceanalyzer.grpc.FlowUnitMessage; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.configs.OldGenContendedRcaConfig; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.Rca; @@ -38,6 +39,7 @@ public class OldGenContendedRca extends Rca> { private static final Logger LOG = LogManager.getLogger(OldGenContendedRca.class); + private static final String OLD_GEN_CONTENDED_METRIC = "OldGenContended"; private static final long GB_TO_B = 1024 * 1024 * 1024; private static final long EVAL_INTERVAL_IN_S = 5; private Rca> highOldGenOccupancyRca; @@ -101,6 +103,7 @@ public ResourceFlowUnit operate() { summary.appendNestedSummary(oldGenReclamationFlowUnit.getSummary()); ResourceContext context = new ResourceContext(State.CONTENDED); + StatsCollector.instance().logMetric(OLD_GEN_CONTENDED_METRIC); return new ResourceFlowUnit<>(currTime, context, summary); } } diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/OldGenReclamationRca.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/OldGenReclamationRca.java index da557ea94..7f9b22874 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/OldGenReclamationRca.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/store/rca/jvmsizing/OldGenReclamationRca.java @@ -15,6 +15,7 @@ package com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.store.rca.jvmsizing; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.StatsCollector; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.Metric; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.Resources.State; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.aggregators.SlidingWindow; @@ -29,6 +30,8 @@ public class OldGenReclamationRca extends OldGenRca> { + private static final String OLD_GEN_RECLAMATION_INEFFECTIVE_METRIC = + "OldGenReclamationIneffective"; private static final long EVAL_INTERVAL_IN_S = 5; private static final double DEFAULT_TARGET_UTILIZATION_AFTER_GC = 75.0d; private static final int DEFAULT_RCA_EVALUATION_INTERVAL_IN_S = 60; @@ -95,6 +98,7 @@ public ResourceFlowUnit operate() { targetHeapUtilizationAfterGc, minOldGenSlidingWindow.readMin(), rcaEvaluationIntervalInS); context = new ResourceContext(State.UNHEALTHY); + StatsCollector.instance().logMetric(OLD_GEN_RECLAMATION_INEFFECTIVE_METRIC); prevSummary = summary; prevContext = context; return new ResourceFlowUnit<>(currTime, context, summary);