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

Optimizes calculating stats when only CPU and Memory stats are returned from Kubelet stats/summary http endpoint. #68841

Merged
merged 2 commits into from Oct 18, 2018

Conversation

@krzysztof-jastrzebski
Contributor

krzysztof-jastrzebski commented Sep 19, 2018

What this PR does / why we need it:
PR optimizes calculating stats when only CPU and Memory stats are returned from Kubelet stats/summary http endpoint. After this PR is submitted only CPU and memory stats will be calculated instead of calculating all stats and removing them from response.

Release note:

Optimizes calculating stats when only CPU and Memory stats are returned from Kubelet stats/summary http endpoint. 
Add "only_cpu_and_memory" GET parameter to /stats/summary http handle…
…r in kubelet. If parameter is true then only cpu and memory will be present in response. The parameter will be used by Metric Server to avoid sending/decoding unneeded data.
@losipiuk

This comment has been minimized.

Contributor

losipiuk commented Sep 20, 2018

/ok-to-test

Process only CPU and memory stats when Kubelete stats API is called with
only_cpu_and_memory parameter. Before all stats were processed and
removed before returning.

@krzysztof-jastrzebski krzysztof-jastrzebski changed the title from WIP: Process only CPU and memory stats when Kubelete stats API is called. to Optimizes calculating stats when only CPU and Memory stats are returned from Kubelet stats/summary http endpoint. Sep 20, 2018

@krzysztof-jastrzebski

This comment has been minimized.

Contributor

krzysztof-jastrzebski commented Sep 20, 2018

/assign mwielgus
/assign yujuhong

@yujuhong

This comment has been minimized.

Contributor

yujuhong commented Sep 26, 2018

/assign @dashpole

@dashpole is working on core metrics and probably have more opinions on this part of the code.

@dashpole

This comment has been minimized.

Contributor

dashpole commented Sep 26, 2018

/kind cleanup

@dashpole

This comment has been minimized.

Contributor

dashpole commented Sep 26, 2018

/lgtm
This is basically a copy of the existing Get() function stack, but with the unused parts removed. It copies a lot of code, but given #67829 (comment), I think this is a decent approach.

@k8s-ci-robot k8s-ci-robot added the lgtm label Sep 26, 2018

@krzysztof-jastrzebski

This comment has been minimized.

Contributor

krzysztof-jastrzebski commented Oct 18, 2018

Could you give approve?

@yujuhong

This comment has been minimized.

Contributor

yujuhong commented Oct 18, 2018

/approve
based on @dashpole's lgtm

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Oct 18, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: krzysztof-jastrzebski, yujuhong

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.

fejta-bot commented Oct 18, 2018

/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 comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 4339a70 into kubernetes:master Oct 18, 2018

18 checks passed

cla/linuxfoundation krzysztof-jastrzebski 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-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-e2e-kubeadm-gce Skipped
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment