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

Kubelet: add usageNanoCores from CRI stats provider #73659

Merged
merged 1 commit into from Feb 9, 2019

Conversation

feiskyer
Copy link
Member

@feiskyer feiskyer commented Feb 2, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

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?:

Kubelet: add usageNanoCores from CRI stats provider

/sig windows
/sig node
/assign @yujuhong @PatrickLang

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Feb 2, 2019
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/windows Categorizes an issue or PR as relevant to SIG Windows. sig/node Categorizes an issue or PR as relevant to SIG Node. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 2, 2019
@feiskyer feiskyer added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 2, 2019
@feiskyer
Copy link
Member Author

feiskyer commented Feb 3, 2019

/retest

@michmike
Copy link
Contributor

michmike commented Feb 4, 2019

@aserdean can you also please take a look?

@PatrickLang PatrickLang added this to Backlog in SIG-Windows Feb 5, 2019
@PatrickLang PatrickLang moved this from Backlog to In Review in SIG-Windows Feb 5, 2019
@PatrickLang
Copy link
Contributor

/milestone v1.14

@k8s-ci-robot k8s-ci-robot added this to the v1.14 milestone Feb 5, 2019
Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

looks good overall!

pkg/kubelet/stats/cri_stats_provider.go Outdated Show resolved Hide resolved
@feiskyer
Copy link
Member Author

feiskyer commented Feb 7, 2019

@dashpole Addressed comments. PTAL

@dashpole
Copy link
Contributor

dashpole commented Feb 7, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 7, 2019
@PatrickLang
Copy link
Contributor

/approve

@PatrickLang
Copy link
Contributor

/retest

@PatrickLang
Copy link
Contributor

/assign @yujuhong
Can you approve?

@derekwaynecarr
Copy link
Member

the change looks good to me as well.

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2019
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot
Copy link
Contributor

@feiskyer: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-local-e2e-containerized 01fbca2 link /test pull-kubernetes-local-e2e-containerized

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.

@k8s-ci-robot k8s-ci-robot merged commit ee44e24 into kubernetes:master Feb 9, 2019
SIG-Windows automation moved this from In Review to Done (v.1.14) Feb 9, 2019
@feiskyer feiskyer deleted the usage-nano-cores branch February 9, 2019 04:56
defer p.mutex.Unlock()

for k, v := range p.cpuUsageCache {
if v == nil {
Copy link
Contributor

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 ?

Copy link
Member Author

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()
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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) ?

@yujuhong
Copy link
Contributor

I was out last week. Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report CPU usageNanoCores for pods/containers in summary API on Windows
9 participants