node-api/node/types.go

28 lines
990 B
Go
Raw Normal View History

2020-07-21 21:11:56 +00:00
package node
import "github.com/jinzhu/gorm"
// Node keeps info about server
type Node struct {
Index float64 `json:"index"` // 0 is empty server, 1 means full server
Load1Index float64 `json:"load1_index"` // 0 is empty server, 1 means resource fully used
Load5Index float64 `json:"load5_index"` // 0 is empty server, 1 means resource fully used
Load15Index float64 `json:"load15_index"` // 0 is empty server, 1 means resource fully used
MemoryIndex float64 `json:"memory_index"` // 0 is empty server, 1 means resource fully used
DiskSpaceIndex float64 `json:"disk_space_index"` // 0 is empty server, 1 means resource fully used
// TODO not implemented
SoldMemory int `json:"-"` // allocated to containers
}
// PerformanceLog keeps track of performance history
type PerformanceLog struct {
gorm.Model
Load1 float64
Load5 float64
Load15 float64
DiskSpaceUsage float64
Memory float64
}