Skip to content

Commit

Permalink
koordlet: define GPU metric struct (#343)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Liu <jasonliu747@gmail.com>
  • Loading branch information
jasonliu747 committed Jul 8, 2022
1 parent 1328009 commit 171ad3e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/koordlet/metriccache/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ type CPUMetric struct {
CPUUsed resource.Quantity
}

type GPUMetric struct {
Minor int32 // index starting from 0
DeviceUUID string // device UUID
SMUtil resource.Quantity // current utilization rate for the device
MemoryUsed resource.Quantity // used memory on the device, in bytes
}

type MemoryMetric struct {
MemoryWithoutCache resource.Quantity
}
Expand All @@ -37,6 +44,7 @@ type CPUThrottledMetric struct {
type NodeResourceMetric struct {
CPUUsed CPUMetric
MemoryUsed MemoryMetric
GPUs []*GPUMetric
}

type NodeResourceQueryResult struct {
Expand All @@ -48,6 +56,7 @@ type PodResourceMetric struct {
PodUID string
CPUUsed CPUMetric
MemoryUsed MemoryMetric
GPUs []*GPUMetric
}

type PodResourceQueryResult struct {
Expand All @@ -59,6 +68,7 @@ type ContainerResourceMetric struct {
ContainerID string
CPUUsed CPUMetric
MemoryUsed MemoryMetric
GPUs []*GPUMetric
}

type ContainerResourceQueryResult struct {
Expand Down

0 comments on commit 171ad3e

Please sign in to comment.