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

scheduler: add elastic quota metric #1716

Merged
merged 1 commit into from Oct 19, 2023

Conversation

shaloulcy
Copy link
Contributor

Ⅰ. Describe what this PR does

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (3270ae7) 65.92% compared to head (8b25e6e) 65.98%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1716      +/-   ##
==========================================
+ Coverage   65.92%   65.98%   +0.06%     
==========================================
  Files         385      386       +1     
  Lines       41702    41879     +177     
==========================================
+ Hits        27490    27635     +145     
- Misses      12174    12198      +24     
- Partials     2038     2046       +8     
Flag Coverage Δ
unittests 65.98% <79.03%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
pkg/scheduler/plugins/elasticquota/metrics.go 100.00% <100.00%> (ø)
pkg/scheduler/plugins/elasticquota/controller.go 56.25% <71.11%> (+7.29%) ⬆️

... and 10 files with indirect coverage changes

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

)

var (
ElasticQuotaSpecMinimum = metrics.NewGaugeVec(&metrics.GaugeOpts{
Copy link
Member

Choose a reason for hiding this comment

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

建议把这些指标合并,min/max/sharedweight等都已label形式处理。

)
}

func ReportMetricsByResourceList(gaugeVec *metrics.GaugeVec, resources corev1.ResourceList, labels map[string]string) {
Copy link
Member

Choose a reason for hiding this comment

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

这里应该是个Update行为,用Report不是太合适。

}

func reportResourceMetric(gaugeVec *metrics.GaugeVec, quant int64, resourceName string, basicLabels map[string]string) {
labels := make(map[string]string)
Copy link
Member

Choose a reason for hiding this comment

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

这里应该不需要再创建一个labels map了。gaugae.With方法不会存储这个map的,所以可以直接复用。

@eahydra eahydra changed the title koord-scheduler: add elastic quota metric scheduler: add elastic quota metric Oct 19, 2023
@eahydra
Copy link
Member

eahydra commented Oct 19, 2023

/cc @hormes @xulinfei1996

@koordinator-bot koordinator-bot bot requested a review from hormes October 19, 2023 07:43
@koordinator-bot
Copy link

@eahydra: GitHub didn't allow me to request PR reviews from the following users: xulinfei1996.

Note that only koordinator-sh members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @hormes @xulinfei1996

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: chuanyun.lcy <chuanyun.lcy@alibaba-inc.com>
Copy link
Member

@eahydra eahydra left a comment

Choose a reason for hiding this comment

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

/lgtm

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hormes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@koordinator-bot koordinator-bot bot merged commit 13f9efa into koordinator-sh:main Oct 19, 2023
21 checks passed
ls-2018 pushed a commit to ls-2018/koordinator that referenced this pull request Mar 25, 2024
Signed-off-by: chuanyun.lcy <chuanyun.lcy@alibaba-inc.com>
Co-authored-by: chuanyun.lcy <chuanyun.lcy@alibaba-inc.com>
ls-2018 pushed a commit to ls-2018/koordinator that referenced this pull request Mar 25, 2024
Signed-off-by: chuanyun.lcy <chuanyun.lcy@alibaba-inc.com>
Co-authored-by: chuanyun.lcy <chuanyun.lcy@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants