package models

import "time"

type GatewaySysInfo struct {
	ID           uint64  `gorm:"primary_key"`
	GID          string  `gorm:"type:varchar(32)"`  //网关ID
	AppName      string  `gorm:"type:varchar(32)"`  //应用名称
	AppVersion   string  `gorm:"type:varchar(12)"`  //应用版本
	CpuCnt       int     `gorm:"type:int"`          //CPU数
	CpuCores     int     `gorm:"type:int"`          //CPU核心数
	CpuModelName string  `gorm:"type:varchar(128)"` //CPU型号名称
	CpuPercent   float64 `gorm:"type:float"`        //状态信息
	MemTotal     uint64  `gorm:"type:int"`          //内存总数，单位M
	MemAvailable uint64  `gorm:"type:int"`          //可用内存
	MemUsed      uint64  `gorm:"type:int"`          //已用内存
	MemPercent   float64 `gorm:"type:float"`        //内存使用占比
	DiskInfos    string  `gorm:"type:text"`         //磁盘信息
	NetIfs       string  `gorm:"type:text"`         //网卡信息
	TcpListen    string  `gorm:"type:text"`         //tcp监听信息
	TcpConn      string  `gorm:"type:text"`         //tcp连接信息
	Udp          string  `gorm:"type:text"`         //udp信息
	Process      string  `gorm:"type:text"`         //进程信息
	CreatedAt    time.Time
}

func (GatewaySysInfo) TableName() string {
	return "t_gateway_sysinfo"
}
