Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to trigger a notification if CPU recommendations are unavailable at profile level. #1156

Merged
merged 5 commits into from
Apr 17, 2024

Conversation

msvinaykumar
Copy link
Contributor

Updated to trigger a notification if CPU recommendations are unavailable at profile level.

following notifications are missed

"CPU Usage is less than a millicore, No CPU Recommendations can be generated"
"CPU usage is zero, No CPU Recommendations can be generated"

…ble at profile level.

Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Copy link
Member

@bharathappali bharathappali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

But I feel we need to have unified notification structure in future.

I see engineNotifications object is created at same level and notifications are populated to that and at the end they are being added to recommendationModel if we have notifications object passed we should make use of the same object instead of creating a new one.

@chandrams
Copy link
Contributor

@msvinaykumar - Can you please update the function test suite with tests to ensure such regressions are not missed out. You can refer this issue to check for tests added for which notifications. Thank you.

@msvinaykumar
Copy link
Contributor Author

@msvinaykumar - Can you please update the function test suite with tests to ensure such regressions are not missed out. You can refer this issue to check for tests added for which notifications. Thank you.

@chandrams was there any previously written test cases check for CPU usage being zero or less than a millicore. Or Do I need to include new test cases?

@chandrams
Copy link
Contributor

@msvinaykumar - Tests for these notifications aren't present in the testsuite, new tests are required. You can check the issue above to see for which notification codes tests were added earlier.

Comment on lines +1231 to +1235
//Set all existing notifications
for (RecommendationNotification recommendationNotification : notifications) {
recommendationModel.addNotification(recommendationNotification);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right place to add these notifications? Can you please paste an example JSON object that has this notification

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason notifications aren't being set is because the function checks if the flag isRecommendedCPURequestAvailable is set to false. In such cases, these notifications are lost, despite the existing code intending to set a notification here.

https://privatebin.corp.redhat.com/?0252306990b9c2fc#5KA1424pqZhQbbogX7uD8ho36VJk5jngts69uU9F4jYV

Signed-off-by: msvinaykumar <vinakuma@redhat.com>
@msvinaykumar
Copy link
Contributor Author

@msvinaykumar - Tests for these notifications aren't present in the testsuite, new tests are required. You can check the issue above to see for which notification codes tests were added earlier.

done

…e and memory zero

Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Copy link
Contributor

@chandrams chandrams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Copy link
Contributor

@dinogun dinogun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dinogun dinogun merged commit 7cd5ced into kruize:mvp_demo Apr 17, 2024
3 checks passed
@rbadagandi1 rbadagandi1 added this to the Kruize 0.0.21_rm Release milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants