Skip to content

feat: add used_percent for cgroups#624

Merged
gaius-qi merged 1 commit intomainfrom
feature/cgroup
Feb 10, 2026
Merged

feat: add used_percent for cgroups#624
gaius-qi merged 1 commit intomainfrom
feature/cgroup

Conversation

@gaius-qi
Copy link
Member

Description

This pull request introduces new fields to track resource usage percentages in cgroup-related data structures and updates the validation logic accordingly. The main focus is on adding a used_percent field to both CPU and memory cgroup types across protobuf definitions, generated code, and Rust structures.

Enhancements to cgroup resource tracking:

  • Added the used_percent field to the CgroupCPU and CgroupMemory messages in pkg/apis/common/v2/common.proto and proto/common.proto to represent the percentage of CPU and memory used by a cgroup. [1] [2] [3] [4]
  • Updated the corresponding Rust structs CgroupCpu and CgroupMemory in src/common.v2.rs to include the new used_percent field. [1] [2]

Validation logic updates:

  • Modified the generated validation code in pkg/apis/common/v2/common.pb.validate.go to acknowledge that there are no validation rules for the new UsedPercent fields in both CPU and memory cgroup types. [1] [2]

Version bump:

  • Incremented the package version in Cargo.toml from 2.2.17 to 2.2.18 to reflect the new changes.

Related Issue

Motivation and Context

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi self-assigned this Feb 10, 2026
@gaius-qi gaius-qi added the enhancement New feature or request label Feb 10, 2026
@gaius-qi gaius-qi enabled auto-merge (squash) February 10, 2026 03:03
Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@gaius-qi gaius-qi merged commit 21ada9b into main Feb 10, 2026
5 checks passed
@gaius-qi gaius-qi deleted the feature/cgroup branch February 10, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments