-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Kubelet: add usageNanoCores from CRI stats provider #73659
Conversation
35a204f
to
e9ec683
Compare
/retest |
@aserdean can you also please take a look? |
/milestone v1.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall!
@dashpole Addressed comments. PTAL |
e9ec683
to
01fbca2
Compare
/lgtm |
/approve |
/retest |
/assign @yujuhong |
the change looks good to me as well. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: derekwaynecarr, feiskyer, PatrickLang 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 |
/retest Review the full test history for this PR. Silence the bot with an |
@feiskyer: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
defer p.mutex.Unlock() | ||
|
||
for k, v := range p.cpuUsageCache { | ||
if v == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stats.Cpu is checked on line 546 above, when would the value be nil ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for preventing panics, e.g. in tests
} | ||
|
||
func (p *criStatsProvider) cleanupOutdatedCaches() { | ||
p.mutex.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there may not be any expired entries for successive calls to cleanupOutdatedCaches, I wonder if the func can return early if it is called within defaultCachePeriod of the previous call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, but that requires more work here, e.g. another property indicating the oldest Timestamp in the cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a property recording the time of last cleanup (so that we don't call this so often) ?
I was out last week. Thanks for fixing this! |
What type of PR is this?
What this PR does / why we need it:
Kubelet: add usageNanoCores from CRI stats provider.
Which issue(s) this PR fixes:
Fixes #72788
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
/sig windows
/sig node
/assign @yujuhong @PatrickLang