Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSystemInfo ¶
func GetSystemUsers ¶
Types ¶
type ExternalNetInterfaceInfo ¶
type ExternalNetInterfaceInfo struct {
Addrs string `json:"addrs"`
}
type ExternalNetworkInfo ¶
type ExternalNetworkInfo struct {
Addr string `json:"ex_addr"`
}
func GetExternalIp ¶
func GetExternalIp() (ExternalNetworkInfo, error)
type HealthInfo ¶
type HealthInfo struct { Timestamp int64 `json:"timestamp"` CPUPercent float64 `json:"cpu_percent"` MemoryPercent float64 `json:"memory_percent"` // kb/sec NetworkUpload float64 `json:"network_upload"` NetworkDownload float64 `json:"network_download"` // kb/sec DiskWrite float64 `json:"disk_write"` DiskRead float64 `json:"disk_read"` DiskUsage *DiskStat `json:"disk_usage"` }
type NetInterfaceAddr ¶
type NetInterfaceInfo ¶
type NetInterfaceInfo struct { Index int `json:"index"` MTU int `json:"mtu"` Name string `json:"name"` HardwareAddr string `json:"hardware_addr"` Flags string `json:"flags"` Addrs []*NetInterfaceAddr `json:"addrs"` MulticastAddrs []*NetInterfaceAddr `json:"multicase_addrs"` }
func (*NetInterfaceInfo) String ¶
func (p *NetInterfaceInfo) String() (str string)
type NetworkInfo ¶
type NetworkInfo struct {
Interfaces []*NetInterfaceInfo `json:"interfaces"`
}
func GetNetworkInfo ¶
func GetNetworkInfo() (*NetworkInfo, error)
type SystemMatrix ¶
type SystemMatrix struct { NodeId string `json:"node_id"` GOARCH string `json:"arch"` GOOS string `json:"os"` Version string `json:"version"` Users []*host.UserStat `json:"users"` ExternalNetwork string `json:"external_network"` Network *NetworkInfo `json:"network"` Matrix *host.InfoStat `json:"matrix"` HealthInfos []*HealthInfo `json:"health_infos"` NodeAliveDuration uint64 `json:"node_alive_duration"` }
func NewSystemMatrixBase ¶
func NewSystemMatrixBase() (*SystemMatrix, error)
func (*SystemMatrix) GetMainMacAndMainNetAddr ¶
func (p *SystemMatrix) GetMainMacAndMainNetAddr() (mainMac, mainNetAddr string)
获取主mac
func (*SystemMatrix) String ¶
func (p *SystemMatrix) String() (str string)
func (*SystemMatrix) UserToString ¶
func (p *SystemMatrix) UserToString() (allUser string)
所有用户tostring
Click to show internal directories.
Click to hide internal directories.