kruize / autotune

Autonomous Performance Tuning for Kubernetes!
Apache License 2.0
158 stars 54 forks source link

Multiple data structures getting created while adding notifications #1157

Open bharathappali opened 5 months ago

bharathappali commented 5 months ago

In src/main/java/com/autotune/analyser/recommendations/engine/RecommendationEngine.java we have a function populateRecommendation which is receiving a notification object and yet creating a new arraylist with name engineNotifications

// build the engine level notifications here
ArrayList<RecommendationNotification> engineNotifications = new ArrayList<>();

These engineNotifications are added to recommendationModel object

// set the engine level notifications here
for (RecommendationNotification recommendationNotification : engineNotifications) {
    recommendationModel.addNotification(recommendationNotification);
}

While the PR #1156 adds the mechanism to add notifications in the notifications to recommendationModel I feel the notifications added to engineNotifications can be added to notifications object as they are getting added to recommendationModel in the end.

@dinogun @msvinaykumar @khansaad Please let me know your views on this. Thanks in advance!