Skip to content

Commit

Permalink
Add cpu cores to storage node
Browse files Browse the repository at this point in the history
Signed-off-by: dahuang <[email protected]>
  • Loading branch information
dahuang-purestorage committed Oct 2, 2023
1 parent fb0df1e commit 85e7f70
Show file tree
Hide file tree
Showing 6 changed files with 4,018 additions and 3,996 deletions.
7 changes: 5 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ type Node struct {
SchedulerNodeName string
// Cpu usage of the node.
Cpu float64 // percentage.
// Number of CPU cores
CpuCores int
// Total Memory of the node
MemTotal uint64
// Used Memory of the node
Expand Down Expand Up @@ -336,7 +338,8 @@ type CredUpdateRequest struct {

// StatPoint represents the basic structure of a single Stat reported
// TODO: This is the first step to introduce stats in openstorage.
// Follow up task is to introduce an API for logging stats
//
// Follow up task is to introduce an API for logging stats
type StatPoint struct {
// Name of the Stat
Name string
Expand Down Expand Up @@ -746,7 +749,6 @@ type CapacityUsageResponse struct {
Error error
}

//
// DriverTypeSimpleValueOf returns the string format of DriverType
func DriverTypeSimpleValueOf(s string) (DriverType, error) {
obj, err := simpleValueOf("driver_type", DriverType_value, s)
Expand Down Expand Up @@ -1016,6 +1018,7 @@ func (s *Node) ToStorageNode() *StorageNode {
Id: s.Id,
SchedulerNodeName: s.SchedulerNodeName,
Cpu: s.Cpu,
CpuCores: int64(s.CpuCores),
MemTotal: s.MemTotal,
MemUsed: s.MemUsed,
MemFree: s.MemFree,
Expand Down
Loading

0 comments on commit 85e7f70

Please sign in to comment.