Documentation
¶
Index ¶
- func CPUinfo() ([]cpu.InfoStat, error)
- func Connections() ([]net.ConnectionStat, error)
- func ContainersID() ([]string, error)
- func Sessions() ([]host.UserStat, error)
- func Users() ([]*user.User, error)
- type CPUStat
- type CPUStatFormat
- type ContainerStat
- type ContainerStatFormat
- type DiskStat
- type DiskStatFormat
- type GeneralStatFormat
- type HostStat
- type HostStatFormat
- type MemoryStat
- type MemoryStatFormat
- type NetworkStat
- type NetworkStatFormat
- type ProcessLightStat
- type ProcessLightStatFormat
- type ProcessStat
- type ProcessStatFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connections ¶
func Connections() ([]net.ConnectionStat, error)
Connections return all active connection
Types ¶
type CPUStat ¶
type CPUStat struct {
Count cpuCount `json:"count"`
Info []cpuInfo `json:"info"`
}
CPUStat desc
type CPUStatFormat ¶
type CPUStatFormat struct {
Count cpuCountFormat `json:"count"`
Info []cpuInfoFormat `json:"info"`
}
CPUStatFormat desc
func (CPUStatFormat) String ¶
func (cs CPUStatFormat) String() string
type ContainerStat ¶
type ContainerStat struct {
ContainerID string `json:"containerId"`
Name string `json:"name"`
Image string `json:"image"`
Status string `json:"status"`
Running bool `json:"running"`
CPU containerCPUStat `json:"cpu"`
Memory containerMemStat `json:"memory"`
}
ContainerStat def
type ContainerStatFormat ¶
type ContainerStatFormat struct {
ContainerID string `json:"containerId"`
Name string `json:"name"`
Image string `json:"image"`
Status string `json:"status"`
Running string `json:"running"`
CPU containerCPUStatFormat `json:"cpu"`
Memory containerMemStatFormat `json:"memory"`
}
ContainerStatFormat def
func (ContainerStatFormat) String ¶
func (ds ContainerStatFormat) String() string
type DiskStat ¶
type DiskStat struct {
Device string `json:"device"`
Mountpoint string `json:"mountpoint"`
Fstype string `json:"fstype"`
Opts string `json:"opts"`
Usage diskUsage `json:"usage"`
IOCounters diskCounters `json:"iocounters"`
}
DiskStat def
type DiskStatFormat ¶
type DiskStatFormat struct {
Device string `json:"device"`
Mountpoint string `json:"mountpoint"`
Fstype string `json:"fstype"`
Opts string `json:"opts"`
Usage diskUsageFormat `json:"usage"`
IOCounters diskCountersFormat `json:"iocounters"`
}
DiskStatFormat def
func (DiskStatFormat) String ¶
func (d DiskStatFormat) String() string
type GeneralStatFormat ¶
type GeneralStatFormat struct {
CPU CPUStatFormat `json:"cpu"`
Disks []DiskStatFormat `json:"disks"`
Containers []ContainerStatFormat `json:"containers"`
Host HostStatFormat `json:"host"`
Memory MemoryStatFormat `json:"memory"`
Network NetworkStatFormat `json:"network"`
Processes []ProcessLightStatFormat `json:"processes"`
}
GeneralStatFormat def
type HostStat ¶
type HostStat struct {
Hostname string `json:"hostname"`
Uptime second `json:"uptime"`
BootTime systemtime `json:"bootTime"`
Procs number `json:"procs"`
OS string `json:"os"`
Platform string `json:"platform"`
PlatformFamily string `json:"platformFamily"`
PlatformVersion string `json:"platformVersion"`
KernelVersion string `json:"kernelVersion"`
VirtualizationSystem string `json:"virtualizationSystem"`
VirtualizationRole string `json:"virtualizationRole"`
HostID string `json:"hostid"`
Sensors []sensorStat `json:"sensors"`
}
HostStat def
type HostStatFormat ¶
type HostStatFormat struct {
Hostname string `json:"hostname"`
Uptime string `json:"uptime"`
BootTime string `json:"bootTime"`
Procs string `json:"procs"`
OS string `json:"os"`
Platform string `json:"platform"`
PlatformFamily string `json:"platformFamily"`
PlatformVersion string `json:"platformVersion"`
KernelVersion string `json:"kernelVersion"`
VirtualizationSystem string `json:"virtualizationSystem"`
VirtualizationRole string `json:"virtualizationRole"`
HostID string `json:"hostId"`
Sensors []sensorStatFormat `json:"sensors"`
}
HostStatFormat def
func (HostStatFormat) String ¶
func (hs HostStatFormat) String() string
type MemoryStat ¶
type MemoryStat struct {
Total byte `json:"total"`
Available byte `json:"available"`
Used byte `json:"used"`
UsedPercent percent `json:"usedPercent"`
Free byte `json:"free"`
}
MemoryStat desc
type MemoryStatFormat ¶
type MemoryStatFormat struct {
Total string `json:"total"`
Available string `json:"available"`
Used string `json:"used"`
Usedpercent string `json:"usedpercent"`
Free string `json:"free"`
}
MemoryStatFormat desc
func (MemoryStatFormat) String ¶
func (ms MemoryStatFormat) String() string
type NetworkStat ¶
type NetworkStat struct {
Usage networkIOCounter `json:"usage"`
Interfaces []networkInterface `json:"interfaces"`
}
NetworkStat def
type NetworkStatFormat ¶
type NetworkStatFormat struct {
Usage networkIOCounterFormat `json:"usage"`
Interfaces []networkInterfaceFormat `json:"interfaces"`
}
NetworkStatFormat def
func (NetworkStatFormat) String ¶
func (ns NetworkStatFormat) String() string
type ProcessLightStat ¶
type ProcessLightStat struct {
Pid number `json:"pid"`
Name string `json:"name"`
Username string `json:"username"`
Status string `json:"status"`
Uids numberSlice `json:"uids"`
Gids numberSlice `json:"gids"`
Terminal string `json:"terminal"`
Cwd string `json:"cwd"`
Exe string `json:"exe"`
CmdArgs []string `json:"cmdArgs"`
Ppid number `json:"ppid"`
CPU processCPUInfo `json:"cpu"`
Memory processMemInfo `json:"memory"`
CreateTime systemtime `json:"createTime"`
}
ProcessLightStat def
func (ProcessLightStat) Format ¶
func (p ProcessLightStat) Format() ProcessLightStatFormat
Format return
func (ProcessLightStat) Text ¶
func (p ProcessLightStat) Text() ProcessLightStatFormat
Text conversion
type ProcessLightStatFormat ¶
type ProcessLightStatFormat struct {
Pid string `json:"pid"`
Name string `json:"name"`
Username string `json:"username"`
Status string `json:"status"`
Uids []string `json:"uids"`
Gids []string `json:"gids"`
Terminal string `json:"terminal"`
Cwd string `json:"cwd"`
Exe string `json:"exe"`
CmdArgs []string `json:"cmdArgs"`
Ppid string `json:"ppid"`
CPU processCPUInfoFormat `json:"cpu"`
Memory processMemInfoFormat `json:"memory"`
CreateTime string `json:"createTime"`
}
ProcessLightStatFormat def
func Processes ¶
func Processes(format bool) ([]ProcessLightStatFormat, error)
Processes return all processes informations
type ProcessStat ¶
type ProcessStat struct {
Pid number `json:"pid"`
Name string `json:"name"`
Username string `json:"username"`
Status string `json:"status"`
Uids numberSlice `json:"uids"`
Gids numberSlice `json:"gids"`
Terminal string `json:"terminal"`
Cwd string `json:"cwd"`
Exe string `json:"exe"`
CmdArgs []string `json:"cmdArgs"`
Ppid number `json:"ppid"`
Parent ProcessLightStat `json:"parent"`
Children []ProcessLightStat `json:"children"`
CPU processCPUInfo `json:"cpu"`
Memory processMemInfo `json:"memory"`
Network networkIOCounter `json:"network"`
Disk processDiskInfo `json:"disk"`
Connections []net.ConnectionStat `json:"connections"`
NumFDS number `json:"numFds"`
OpenFiles []process.OpenFilesStat `json:"openFiles"`
NumThreads number `json:"numThread"`
Threads map[number]cpuTimes `json:"threads"`
Rlimits []processLimit `json:"limits"`
IsRunning bool `json:"isRunning"`
Background bool `json:"background"`
Foreground bool `json:"foreground"`
CreateTime systemtime `json:"createTime"`
}
ProcessStat def
type ProcessStatFormat ¶
type ProcessStatFormat struct {
Pid string `json:"pid"`
Name string `json:"name"`
Username string `json:"username"`
Status string `json:"status"`
Uids []string `json:"uids"`
Gids []string `json:"gids"`
Terminal string `json:"terminal"`
Cwd string `json:"cwd"`
Exe string `json:"exe"`
CmdArgs []string `json:"cmdArgs"`
Ppid string `json:"ppid"`
Parent ProcessLightStatFormat `json:"parent"`
Children []ProcessLightStatFormat `json:"children"`
CPU processCPUInfoFormat `json:"cpu"`
Memory processMemInfoFormat `json:"memory"`
Network networkIOCounterFormat `json:"network"`
Disk processDiskInfoFormat `json:"disk"`
Connections []net.ConnectionStat `json:"connections"`
NumFDS string `json:"numFds"`
OpenFiles []process.OpenFilesStat `json:"openFiles"`
NumThreads string `json:"numThread"`
Threads map[string]cpuTimesFormat `json:"threads"`
Rlimits []processLimitFormat `json:"limits"`
IsRunning bool `json:"isRunning"`
Background bool `json:"background"`
Foreground bool `json:"foreground"`
CreateTime string `json:"createTime"`
}
ProcessStatFormat def
func Process ¶
func Process(pid int32, format bool) (ProcessStatFormat, error)
Process return stat of one process
func (ProcessStatFormat) String ¶
func (p ProcessStatFormat) String() string
Click to show internal directories.
Click to hide internal directories.