Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add more RCA metrics #492

Merged
merged 1 commit into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
public class HighOldGenOccupancyRca extends OldGenRca<ResourceFlowUnit<HotResourceSummary>> {

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;

Expand Down Expand Up @@ -107,6 +108,7 @@ private ResourceFlowUnit<HotResourceSummary> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,6 +39,7 @@
public class OldGenContendedRca extends Rca<ResourceFlowUnit<HotNodeSummary>> {

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<ResourceFlowUnit<HotResourceSummary>> highOldGenOccupancyRca;
Expand Down Expand Up @@ -101,6 +103,7 @@ public ResourceFlowUnit<HotNodeSummary> operate() {
summary.appendNestedSummary(oldGenReclamationFlowUnit.getSummary());

ResourceContext context = new ResourceContext(State.CONTENDED);
StatsCollector.instance().logMetric(OLD_GEN_CONTENDED_METRIC);
return new ResourceFlowUnit<>(currTime, context, summary);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,6 +30,8 @@

public class OldGenReclamationRca extends OldGenRca<ResourceFlowUnit<HotResourceSummary>> {

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;
Expand Down Expand Up @@ -95,6 +98,7 @@ public ResourceFlowUnit<HotResourceSummary> 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);
Expand Down