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

The CPU.Time is always set to Container StartTime in pod metrics #93988

Closed
AbelHu opened this issue Aug 14, 2020 · 5 comments · Fixed by #96123
Closed

The CPU.Time is always set to Container StartTime in pod metrics #93988

AbelHu opened this issue Aug 14, 2020 · 5 comments · Fixed by #96123
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/node Categorizes an issue or PR as relevant to SIG Node.

Comments

@AbelHu
Copy link

AbelHu commented Aug 14, 2020

What happened:

ps.CPU.Time = cs.StartTime
usageCoreNanoSeconds := getUint64Value(cs.CPU.UsageCoreNanoSeconds) + getUint64Value(ps.CPU.UsageCoreNanoSeconds)
usageNanoCores := getUint64Value(cs.CPU.UsageNanoCores) + getUint64Value(ps.CPU.UsageNanoCores)
ps.CPU.UsageCoreNanoSeconds = &usageCoreNanoSeconds
ps.CPU.UsageNanoCores = &usageNanoCores
}
if cs.Memory != nil {
if ps.Memory == nil {
ps.Memory = &statsapi.MemoryStats{}
}
ps.Memory.Time = cs.Memory.Time

CPU.Time is set to cs.StartTime but ps.Memory.Time is set to timestamp when collecting the memoryusage.

What you expected to happen:
CPU.Time is set to cs.CPU.Time

How to reproduce it (as minimally and precisely as possible):
Check the code

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
    master branch when creating this issue.
  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Network plugin and version (if this is a network-related bug):
  • Others:
@AbelHu AbelHu added the kind/bug Categorizes issue or PR as related to a bug. label Aug 14, 2020
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Aug 14, 2020
@Zheaoli
Copy link
Contributor

Zheaoli commented Aug 16, 2020

/assign

@Zheaoli
Copy link
Contributor

Zheaoli commented Aug 16, 2020

/sig kubelet

@k8s-ci-robot
Copy link
Contributor

@Zheaoli: The label(s) sig/kubelet cannot be applied, because the repository doesn't have them

In response to this:

/sig kubelet

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.

@Zheaoli
Copy link
Contributor

Zheaoli commented Aug 16, 2020

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 16, 2020
@qiutongs
Copy link
Contributor

I am happy to take over this.

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants