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

@feiskyer

This comment has been minimized.

Copy link
Member Author

feiskyer commented Feb 3, 2019

/retest

@michmike

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

PatrickLang commented Feb 5, 2019

/milestone v1.14

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

@dashpole
Copy link
Contributor

dashpole left a comment

looks good overall!

Show resolved Hide resolved pkg/kubelet/stats/cri_stats_provider.go Outdated
@feiskyer

This comment has been minimized.

Copy link
Member Author

feiskyer commented Feb 7, 2019

@dashpole Addressed comments. PTAL

@feiskyer feiskyer force-pushed the feiskyer:usage-nano-cores branch from e9ec683 to 01fbca2 Feb 7, 2019

@dashpole

This comment has been minimized.

Copy link
Contributor

dashpole commented Feb 7, 2019

/lgtm

@PatrickLang

This comment has been minimized.

Copy link
Contributor

PatrickLang commented Feb 7, 2019

/approve

@PatrickLang

This comment has been minimized.

Copy link
Contributor

PatrickLang commented Feb 7, 2019

/retest

@PatrickLang

This comment has been minimized.

Copy link
Contributor

PatrickLang commented Feb 7, 2019

/assign @yujuhong
Can you approve?

@derekwaynecarr

This comment has been minimized.

Copy link
Member

derekwaynecarr commented Feb 8, 2019

the change looks good to me as well.

/approve

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Feb 8, 2019

[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

@fejta-bot

This comment has been minimized.

Copy link

fejta-bot commented Feb 9, 2019

/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

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Feb 9, 2019

@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

15 of 16 checks passed

pull-kubernetes-local-e2e-containerized Job failed.
Details
cla/linuxfoundation feiskyer authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-godeps Skipped
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
tide In merge pool.
Details

SIG-Windows automation moved this from In Review to Done (v.1.14) Feb 9, 2019

@feiskyer feiskyer deleted the feiskyer:usage-nano-cores branch Feb 9, 2019

defer p.mutex.Unlock()

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

This comment has been minimized.

@tedyu

tedyu Feb 9, 2019

Contributor

stats.Cpu is checked on line 546 above, when would the value be nil ?

This comment has been minimized.

@feiskyer

feiskyer Feb 11, 2019

Author Member

this is for preventing panics, e.g. in tests

}

func (p *criStatsProvider) cleanupOutdatedCaches() {
p.mutex.Lock()

This comment has been minimized.

@tedyu

tedyu Feb 9, 2019

Contributor

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.

This comment has been minimized.

@feiskyer

feiskyer Feb 11, 2019

Author Member

yep, but that requires more work here, e.g. another property indicating the oldest Timestamp in the cache.

This comment has been minimized.

@tedyu

tedyu Feb 11, 2019

Contributor

How about adding a property recording the time of last cleanup (so that we don't call this so often) ?

@yujuhong

This comment has been minimized.

Copy link
Member

yujuhong commented Feb 11, 2019

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
You can’t perform that action at this time.