Skip to content

Commit

Permalink
Merge pull request #158 from linkernetworks/phstsai/VX-208
Browse files Browse the repository at this point in the history
[Task] VX-208: Remove EphemeralStorage resource from node struct
  • Loading branch information
John-Lin authored Jul 24, 2018
2 parents 6069e60 + 0852afc commit e782dc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
2 changes: 0 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,9 @@ Response Data:
"allocatableCPU": 2,
"allocatableMemory": 4038615000,
"allocatablePods": 110,
"allocatableEphemeralStorage": 9306748000,
"capacityCPU": 2,
"capacityMemory": 4143472600,
"capacityPods": 110,
"capacityEphemeralStorage": 10340831000
},
"nics": {
"cni0": {
Expand Down
22 changes: 10 additions & 12 deletions src/entity/metrics_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@ type NICOverviewMetrics struct {

// NodeResourceMetrics is the structure for node resource metrics
type NodeResourceMetrics struct {
CPURequests float32 `json:"cpuRequests"`
CPULimits float32 `json:"cpuLimits"`
MemoryRequests float32 `json:"memoryRequests"`
MemoryLimits float32 `json:"memoryLimits"`
AllocatableCPU float32 `json:"allocatableCPU"`
AllocatableMemory float32 `json:"allocatableMemory"`
AllocatablePods float32 `json:"allocatablePods"`
AllocatableEphemeralStorage float32 `json:"allocatableEphemeralStorage"`
CapacityCPU float32 `json:"capacityCPU"`
CapacityMemory float32 `json:"capacityMemory"`
CapacityPods float32 `json:"capacityPods"`
CapacityEphemeralStorage float32 `json:"capacityEphemeralStorage"`
CPURequests float32 `json:"cpuRequests"`
CPULimits float32 `json:"cpuLimits"`
MemoryRequests float32 `json:"memoryRequests"`
MemoryLimits float32 `json:"memoryLimits"`
AllocatableCPU float32 `json:"allocatableCPU"`
AllocatableMemory float32 `json:"allocatableMemory"`
AllocatablePods float32 `json:"allocatablePods"`
CapacityCPU float32 `json:"capacityCPU"`
CapacityMemory float32 `json:"capacityMemory"`
CapacityPods float32 `json:"capacityPods"`
}

// NodeDetailMetrics is the structure for node detail metrics
Expand Down
4 changes: 0 additions & 4 deletions src/prometheuscontroller/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,6 @@ func GetNode(sp *serviceprovider.Container, id string) (entity.NodeMetrics, erro
node.Resource.AllocatableMemory = float32(result.Value)
case "pods":
node.Resource.AllocatablePods = float32(result.Value)
case "ephemeral_storage":
node.Resource.AllocatableEphemeralStorage = float32(result.Value)
}

case "kube_node_status_capacity":
Expand All @@ -398,8 +396,6 @@ func GetNode(sp *serviceprovider.Container, id string) (entity.NodeMetrics, erro
node.Resource.CapacityMemory = float32(result.Value)
case "pods":
node.Resource.CapacityPods = float32(result.Value)
case "ephemeral_storage":
node.Resource.CapacityEphemeralStorage = float32(result.Value)
}
}
}
Expand Down

0 comments on commit e782dc6

Please sign in to comment.