代码拉取完成,页面将自动刷新
////定义了集群内发生事件的各种事件类型
package core
type IEvent interface {
HappenTime() int64
ObjectType() EventObjectType
}
type EventObjectType uint8
const (
E_MACHINE EventObjectType = iota
E_INSTANCE
)
type Event struct {
Time int64
Object EventObjectType
}
func (e *Event) HappenTime() int64 {
return e.Time
}
func (e *Event) ObjectType() EventObjectType {
return e.Object
}
type InstanceEvent struct {
Event
Type int64
InstanceId InstanceKey
CpuRequest float64
RamRequest float64
MachineID MachineID
AllocID int64
ScheduleClass int64
Priority int64
}
const (
INSTANCESubmit int64 = 0
INSTANCEQueue int64 = 1
INSTANCEEnable int64 = 2
INSTANCESchdule int64 = 3
INSTANCEEvict int64 = 4
INSTANCEFail int64 = 5
INSTANCEFinish int64 = 6
INSTANCEKill int64 = 7
INSTANCELost int64 = 8
INSTANCEUpdatePending int64 = 9
INSTANCEUpdateRunning int64 = 10
)
type UsageEvent struct {
Event
InstanceId InstanceKey
CpuUsage float64
RamUsage float64
MachineID int64
}
const (
MACHINEAdd int64 = 1
MACHINEDelete int64 = 2
MACHINEUpdate int64 = 3
)
type MachineEvent struct {
Event
MachineId MachineID
Type int64
CpuCapacity float64
RamCapacity float64
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。