Skip to content

Commit

Permalink
Use experiment type from kubernetes_object instead of constant
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyabiradar07 committed Oct 8, 2024
1 parent a2f7e12 commit 1cb8a69
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1914,7 +1914,7 @@ private void fetchNamespaceMetricsBasedOnDataSourceAndProfile(KruizeObject kruiz
}

List<Metric> namespaceMetricList = filterMetricsBasedOnExpType(metricProfile,
AnalyzerConstants.MetricName.namespaceMaxDate.name(),AnalyzerConstants.ExperimentTypes.NAMESPACE_EXPERIMENT);
AnalyzerConstants.MetricName.namespaceMaxDate.name(), kruizeObject.getExperimentType());

// Iterate over metrics and aggregation functions
for (Metric metricEntry : namespaceMetricList) {
Expand Down Expand Up @@ -2098,7 +2098,7 @@ private void fetchContainerMetricsBasedOnDataSourceAndProfile(KruizeObject kruiz
MetricAggregationInfoResults metricAggregationInfoResults = null;

List<Metric> metricList = filterMetricsBasedOnExpType(metricProfile,
AnalyzerConstants.MetricName.maxDate.name(),AnalyzerConstants.ExperimentTypes.CONTAINER_EXPERIMENT);
AnalyzerConstants.MetricName.maxDate.name(), kruizeObject.getExperimentType());

List<String> acceleratorFunctions = Arrays.asList(
AnalyzerConstants.MetricName.gpuCoreUsage.toString(),
Expand Down Expand Up @@ -2386,10 +2386,10 @@ public List<Metric> filterMetricsBasedOnExpType(PerformanceProfile metricProfile
.filter(Metric -> {
String name = Metric.getName();
if (experimentType.equals(AnalyzerConstants.ExperimentTypes.NAMESPACE_EXPERIMENT)) {
// Include metrics that start with namespace and exclude namespaceMaxDate metric
// Include metrics that start with prefix "namespace" and exclude namespaceMaxDate metric
return name.startsWith(namespace) && !name.equals(maxDateQuery);
} else {
// Exclude metrics that start with namespace or maxDate metric
// Exclude metrics that start with prefix "namespace" and maxDate metric
return !name.startsWith(namespace) && !name.equals(maxDateQuery);
}
})
Expand Down

0 comments on commit 1cb8a69

Please sign in to comment.