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

koordlet: replace int64 with time.Duration in metricsadvisor module #1153

Merged

Conversation

jasonliu747
Copy link
Member

@jasonliu747 jasonliu747 commented Mar 28, 2023

Ⅰ. 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 Mar 28, 2023

Codecov Report

Patch coverage: 60.00% and project coverage change: -0.04 ⚠️

Comparison is base (fad80e6) 66.74% compared to head (483b8f0) 66.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1153      +/-   ##
==========================================
- Coverage   66.74%   66.71%   -0.04%     
==========================================
  Files         273      273              
  Lines       29879    29884       +5     
==========================================
- Hits        19943    19937       -6     
- Misses       8513     8522       +9     
- Partials     1423     1425       +2     
Flag Coverage Δ
unittests 66.71% <60.00%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
...ordlet/metricsadvisor/devices/gpu/collector_gpu.go 0.00% <0.00%> (ø)
pkg/koordlet/metricsadvisor/metrics_advisor.go 86.15% <0.00%> (ø)
pkg/koordlet/resmanager/resmanager.go 55.38% <0.00%> (-2.68%) ⬇️
...sor/collectors/beresource/be_resource_collector.go 67.82% <100.00%> (-6.09%) ⬇️
...lectors/performance/performance_collector_linux.go 61.50% <100.00%> (ø)
...r/collectors/podresource/pod_resource_collector.go 64.10% <100.00%> (ø)
pkg/koordlet/metricsadvisor/framework/config.go 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hormes
Copy link
Member

hormes commented Mar 29, 2023

What is the background for this change?

@jasonliu747
Copy link
Member Author

What is the background for this change?

现在关于时间的单位并不一致,有些是int64,有些是time.Duration,之前讨论过会逐渐统一成 time.Duration,也留了一些TODO

func (c *Config) InitFlags(fs *flag.FlagSet) {
// todo: replace with DurationVar and modify run feature util
fs.IntVar(&c.CollectResUsedIntervalSeconds, "collect-res-used-interval-seconds", c.CollectResUsedIntervalSeconds, "Collect node/pod resource usage interval by seconds")
fs.IntVar(&c.CollectNodeCPUInfoIntervalSeconds, "collect-node-cpu-info-interval-seconds", c.CollectNodeCPUInfoIntervalSeconds, "Collect node cpu info interval by seconds")
fs.IntVar(&c.CPICollectorIntervalSeconds, "cpi-collector-interval-seconds", c.CPICollectorIntervalSeconds, "Collect cpi interval by seconds")
fs.IntVar(&c.PSICollectorIntervalSeconds, "psi-collector-interval-seconds", c.PSICollectorIntervalSeconds, "Collect psi interval by seconds")
fs.IntVar(&c.CPICollectorTimeWindowSeconds, "collect-cpi-timewindow-seconds", c.CPICollectorTimeWindowSeconds, "Collect cpi time window by seconds")
}

pkg/koordlet/koordlet.go Outdated Show resolved Hide resolved
Signed-off-by: Jason Liu <jasonliu747@gmail.com>
@zwzhang0107
Copy link
Contributor

/lgtm

Copy link
Member Author

@jasonliu747 jasonliu747 left a comment

Choose a reason for hiding this comment

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

/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasonliu747

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 2c4a5d5 into koordinator-sh:main Mar 31, 2023
9 checks passed
@jasonliu747 jasonliu747 deleted the refactor-collector-flag branch March 31, 2023 06:30
@eahydra eahydra added this to the v1.2 milestone Apr 5, 2023
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

5 participants