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

Add cgroup_memory_migrate metric #2796

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

kwisniewski98
Copy link
Contributor

Signed-off-by: Wisniewski, Krzysztof2 [email protected]

@k8s-ci-robot
Copy link
Collaborator

Hi @kwisniewski98. Thanks for your PR.

I'm waiting for a google member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@Creatone
Copy link
Collaborator

Creatone commented Feb 1, 2021

/ok-to-test

Copy link
Collaborator

@Creatone Creatone left a comment

Choose a reason for hiding this comment

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

Small nit

ContainerData MemoryStatsMemoryData `json:"container_data,omitempty"`
HierarchicalData MemoryStatsMemoryData `json:"hierarchical_data,omitempty"`
}

type CPUSetStats struct {
Migrate uint64 `json:"memory_migrate"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you use MemoryMigrate?

Copy link
Collaborator

@iwankgb iwankgb left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -395,10 +395,16 @@ type MemoryStats struct {

Failcnt uint64 `json:"failcnt"`

CpuSet CPUSetStats `json:"cpuset,omitempty"`
Copy link
Collaborator

@bobbypage bobbypage Feb 12, 2021

Choose a reason for hiding this comment

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

curious to get your thoughts: does this make sense under MemoryStats, maybe it needs a top level field?

Since this is taken from the cpuset controller, maybe this makes sense to add a new CpuSets top level field under ContainerStats which will contain the relevant metrics from cpuset: https://man7.org/linux/man-pages/man7/cpuset.7.html

As I understand currently all the fields under MemoryStats actually come from the memory cgroup controller stats, and adding this field will now result some fields from MemoryStats coming from memory cgroup controller and others from cpuset controller.

Thoughts @kwisniewski98 @Creatone @iwankgb ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That will be a good place for other CPUSet metrics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -423,6 +423,14 @@ func NewPrometheusCollector(i infoProvider, f ContainerLabelsFunc, includedMetri
return metricValues{{value: float64(s.Memory.WorkingSet), timestamp: s.Timestamp}}
},
},
{
name: "container_memory_migrate",
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is still under if includedMetrics.Has(container.MemoryUsageMetrics).

I think since we're introducing new CPUSet category of metrics, makes sense to add a new metric kind for CpuSet metrics instead of putting this under existing container memory usage metrics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Wisniewski, Krzysztof2 <[email protected]>
@bobbypage
Copy link
Collaborator

Thanks! LGTM

@bobbypage bobbypage merged commit 4cf47a7 into google:master Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants