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

[YUNIKORN-2876] Initialize queue metrics for app after queue is set #968

Closed
wants to merge 8 commits into from

Conversation

zhuqi-lucas
Copy link
Contributor

@zhuqi-lucas zhuqi-lucas commented Sep 13, 2024

…later after the queue placed

What is this PR for?

Currently, we push the queue app new state metrics after application objects are created, but when testing, the dynamic queue should be empty at that time, we need to do this later when we can make sure the queue placed for dynamic case.

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

How should this be tested?

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.97%. Comparing base (9e10746) to head (72c2e71).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #968      +/-   ##
==========================================
+ Coverage   80.95%   80.97%   +0.01%     
==========================================
  Files          97       97              
  Lines       12514    12512       -2     
==========================================
  Hits        10131    10131              
+ Misses       2113     2112       -1     
+ Partials      270      269       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

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

See comments.

metrics.GetQueueMetrics(sa.GetQueuePath()).IncQueueApplicationsNew()
func (sa *Application) SetNewMetrics() {
// ensure the queue is set before calling this function
if sa.GetQueuePath() != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't add a conditional, just execute setNewMetrics() inside SetQueue(). Callers should not need to be updated at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @craigcondit , good suggestion, addressed in latest PR.

@craigcondit craigcondit changed the title [YUNIKORN-2876] Dynamic queue app new state metrics should be pushed … [YUNIKORN-2876] Initialize queue metrics for app after queue is set Sep 17, 2024
Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

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

+1 LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants