Skip to content

Commit 171ad3e

Browse files
authored
koordlet: define GPU metric struct (#343)
Signed-off-by: Jason Liu <jasonliu747@gmail.com>
1 parent 1328009 commit 171ad3e

File tree

1 file changed

+10
-0
lines changed
  • pkg/koordlet/metriccache

1 file changed

+10
-0
lines changed

pkg/koordlet/metriccache/api.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ type CPUMetric struct {
2626
CPUUsed resource.Quantity
2727
}
2828

29+
type GPUMetric struct {
30+
Minor int32 // index starting from 0
31+
DeviceUUID string // device UUID
32+
SMUtil resource.Quantity // current utilization rate for the device
33+
MemoryUsed resource.Quantity // used memory on the device, in bytes
34+
}
35+
2936
type MemoryMetric struct {
3037
MemoryWithoutCache resource.Quantity
3138
}
@@ -37,6 +44,7 @@ type CPUThrottledMetric struct {
3744
type NodeResourceMetric struct {
3845
CPUUsed CPUMetric
3946
MemoryUsed MemoryMetric
47+
GPUs []*GPUMetric
4048
}
4149

4250
type NodeResourceQueryResult struct {
@@ -48,6 +56,7 @@ type PodResourceMetric struct {
4856
PodUID string
4957
CPUUsed CPUMetric
5058
MemoryUsed MemoryMetric
59+
GPUs []*GPUMetric
5160
}
5261

5362
type PodResourceQueryResult struct {
@@ -59,6 +68,7 @@ type ContainerResourceMetric struct {
5968
ContainerID string
6069
CPUUsed CPUMetric
6170
MemoryUsed MemoryMetric
71+
GPUs []*GPUMetric
6272
}
6373

6474
type ContainerResourceQueryResult struct {

0 commit comments

Comments
 (0)