From 761af4e83fcc2c2ca4b02d02cb71afa60eedf5c7 Mon Sep 17 00:00:00 2001 From: Saad Khan Date: Tue, 17 Sep 2024 16:43:38 +0530 Subject: [PATCH] fix pr failures Signed-off-by: Saad Khan --- .../recommendations/engine/RecommendationEngine.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/autotune/analyzer/recommendations/engine/RecommendationEngine.java b/src/main/java/com/autotune/analyzer/recommendations/engine/RecommendationEngine.java index df608f913..577030b30 100644 --- a/src/main/java/com/autotune/analyzer/recommendations/engine/RecommendationEngine.java +++ b/src/main/java/com/autotune/analyzer/recommendations/engine/RecommendationEngine.java @@ -2197,7 +2197,8 @@ public void fetchMetricsBasedOnProfileAndDatasource(KruizeObject kruizeObject, T URLEncoder.encode(namespaceMaxDateQuery, CHARACTER_ENCODING) ); LOGGER.info(dateMetricsUrl); - JSONObject genericJsonObject = new GenericRestApiClient(dateMetricsUrl).fetchMetricsJson(KruizeConstants.APIMessages.GET, ""); + client.setBaseURL(dateMetricsUrl); + JSONObject genericJsonObject = client.fetchMetricsJson(KruizeConstants.APIMessages.GET, ""); JsonObject jsonObject = new Gson().fromJson(genericJsonObject.toString(), JsonObject.class); JsonArray resultArray = jsonObject.getAsJsonObject(KruizeConstants.JSONKeys.DATA).getAsJsonArray(KruizeConstants.DataSourceConstants.DataSourceQueryJSONKeys.RESULT); // Process fetched metrics @@ -2271,7 +2272,8 @@ public void fetchMetricsBasedOnProfileAndDatasource(KruizeObject kruizeObject, T interval_start_time_epoc, interval_end_time_epoc, measurementDurationMinutesInDouble.intValue() * KruizeConstants.TimeConv.NO_OF_SECONDS_PER_MINUTE); - JSONObject genericJsonObject = new GenericRestApiClient(namespaceMetricsUrl).fetchMetricsJson(KruizeConstants.APIMessages.GET, ""); + client.setBaseURL(namespaceMetricsUrl); + JSONObject genericJsonObject = client.fetchMetricsJson(KruizeConstants.APIMessages.GET, ""); JsonObject jsonObject = new Gson().fromJson(genericJsonObject.toString(), JsonObject.class); JsonArray resultArray = jsonObject.getAsJsonObject(KruizeConstants.JSONKeys.DATA).getAsJsonArray(KruizeConstants.DataSourceConstants.DataSourceQueryJSONKeys.RESULT); // Process fetched metrics