src/main/java/org/opensearch/performanceanalyzer/rca/store/rca/OldGenRca.java [214:243]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if (gc_type == null) {
            throw new IllegalStateException(
                    "RCA: "
                            + this.name()
                            + "was not configured in the graph to "
                            + "take GC_Type as a metric. Please check the analysis graph!");
        }

        final List<MetricFlowUnit> gcTypeFlowUnits = gc_type.getFlowUnits();
        Field<String> memTypeField = AllMetrics.GCInfoDimension.MEMORY_POOL.getField();
        Field<String> collectorField = AllMetrics.GCInfoDimension.COLLECTOR_NAME.getField();
        for (MetricFlowUnit gcTypeFlowUnit : gcTypeFlowUnits) {
            if (gcTypeFlowUnit.isEmpty()) {
                continue;
            }

            Result<Record> records = gcTypeFlowUnit.getData();
            for (final Record record : records) {
                final String memType = record.get(memTypeField);
                if (AllMetrics.GCType.OLD_GEN.toString().equals(memType)) {
                    return CMS_COLLECTOR.equals(record.get(collectorField));
                }
            }
        }

        // We want to return true here because we don't want to hold up evaluation of RCAs due to
        // transient metric delays. We don't want to tune the JVM only when we know for sure that
        // the
        // collector is not CMS, in all other cases, give JVM RCAs the benefit of the doubt.
        return true;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/org/opensearch/performanceanalyzer/rca/store/rca/hotheap/HighHeapUsageYoungGenRca.java [308:337]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if (gc_type == null) {
            throw new IllegalStateException(
                    "RCA: "
                            + this.name()
                            + "was not configured in the graph to "
                            + "take GC_Type as a metric. Please check the analysis graph!");
        }

        final List<MetricFlowUnit> gcTypeFlowUnits = gc_type.getFlowUnits();
        Field<String> memTypeField = AllMetrics.GCInfoDimension.MEMORY_POOL.getField();
        Field<String> collectorField = AllMetrics.GCInfoDimension.COLLECTOR_NAME.getField();
        for (MetricFlowUnit gcTypeFlowUnit : gcTypeFlowUnits) {
            if (gcTypeFlowUnit.isEmpty()) {
                continue;
            }

            Result<Record> records = gcTypeFlowUnit.getData();
            for (final Record record : records) {
                final String memType = record.get(memTypeField);
                if (AllMetrics.GCType.OLD_GEN.toString().equals(memType)) {
                    return CMS_COLLECTOR.equals(record.get(collectorField));
                }
            }
        }

        // We want to return true here because we don't want to hold up evaluation of RCAs due to
        // transient metric delays. We don't want to tune the JVM only when we know for sure that
        // the
        // collector is not CMS, in all other cases, give JVM RCAs the benefit of the doubt.
        return true;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



