Documentation ¶
Index ¶
- Variables
- func ListenRealTimeStatus(cfg *Settings)
- func RealTimeStatusIsListening() bool
- func SensorsTemperatures() ([]host.TemperatureStat, error)
- type AlarmThreshold
- type DynamicInformation
- type LastTimeValue
- type MemoryInformation
- type NetIOTimeSeries
- type Process
- type ProcessListSortByCPUPercent
- type ProcessListSortByCPUPercentReverse
- type ProcessListSortByCreated
- type ProcessListSortByCreatedReverse
- type ProcessListSortByMemPercent
- type ProcessListSortByMemPercentReverse
- type ProcessListSortByNumFDs
- type ProcessListSortByNumFDsReverse
- type ProcessListSortByNumThreads
- type ProcessListSortByNumThreadsReverse
- type ProcessListSortByPid
- type ProcessListSortByPidReverse
- type RealTimeStatus
- func (r *RealTimeStatus) CPUAdd(y float64) *RealTimeStatus
- func (r *RealTimeStatus) Listen(ctx context.Context) *RealTimeStatus
- func (r *RealTimeStatus) MemAdd(y float64) *RealTimeStatus
- func (r *RealTimeStatus) NetAdd(stat net.IOCountersStat) *RealTimeStatus
- func (r *RealTimeStatus) SetSettings(c *Settings, interval time.Duration, max int) *RealTimeStatus
- func (r *RealTimeStatus) TempAdd(ts []host.TemperatureStat) *RealTimeStatus
- type RuntimeStatus
- type Settings
- type SystemInformation
- type TimeSeries
- type XY
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// CancelRealTimeStatusCollection 取消实时状态搜集
CancelRealTimeStatusCollection = func() {}
)
Functions ¶
func RealTimeStatusIsListening ¶
func RealTimeStatusIsListening() bool
RealTimeStatusIsListening 是否正在监听实时状态
func SensorsTemperatures ¶
func SensorsTemperatures() ([]host.TemperatureStat, error)
Types ¶
type AlarmThreshold ¶
type DynamicInformation ¶
type DynamicInformation struct { CPUPercent []float64 Load *load.AvgStat `json:",omitempty"` Memory *MemoryInformation `json:",omitempty"` NetIO []net.IOCountersStat `json:",omitempty"` Temp []host.TemperatureStat `json:",omitempty"` }
func (*DynamicInformation) Init ¶
func (d *DynamicInformation) Init() *DynamicInformation
func (*DynamicInformation) MemoryAndCPU ¶
func (d *DynamicInformation) MemoryAndCPU() *DynamicInformation
func (*DynamicInformation) NetMemoryCPU ¶
func (d *DynamicInformation) NetMemoryCPU() *DynamicInformation
func (*DynamicInformation) TemperatureStat ¶
func (d *DynamicInformation) TemperatureStat() *DynamicInformation
type LastTimeValue ¶
LastTimeValue 上次时间的状态值
type MemoryInformation ¶
type MemoryInformation struct { Virtual *mem.VirtualMemoryStat `json:",omitempty"` Swap *mem.SwapMemoryStat `json:",omitempty"` }
type NetIOTimeSeries ¶
type NetIOTimeSeries struct { BytesSent TimeSeries BytesRecv TimeSeries PacketsSent TimeSeries PacketsRecv TimeSeries // contains filtered or unexported fields }
NetIOTimeSeries 网络IO时序数据结构
type Process ¶
type Process struct { Name string `json:"name"` Pid int32 `json:"pid"` Ppid int32 `json:"ppid"` CPUPercent float64 `json:"cpuPercent"` MemPercent float32 `json:"memPercent"` MemUsed uint64 `json:"memUsed"` //Running bool `json:"running"` CreateTime string `json:"createTime"` Exe string `json:"exe"` Cmdline string `json:"cmdline"` Cwd string `json:"cwd"` Status []string `json:"status"` Username string `json:"username"` NumThreads int32 `json:"numThreads"` NumFDs int32 `json:"numFDs"` // contains filtered or unexported fields }
func (*Process) MemoryPercentWithContext ¶
type ProcessListSortByCPUPercent ¶
type ProcessListSortByCPUPercent []*Process
func (ProcessListSortByCPUPercent) Len ¶
func (s ProcessListSortByCPUPercent) Len() int
func (ProcessListSortByCPUPercent) Less ¶
func (s ProcessListSortByCPUPercent) Less(i, j int) bool
func (ProcessListSortByCPUPercent) Swap ¶
func (s ProcessListSortByCPUPercent) Swap(i, j int)
type ProcessListSortByCPUPercentReverse ¶
type ProcessListSortByCPUPercentReverse []*Process
func (ProcessListSortByCPUPercentReverse) Len ¶
func (s ProcessListSortByCPUPercentReverse) Len() int
func (ProcessListSortByCPUPercentReverse) Less ¶
func (s ProcessListSortByCPUPercentReverse) Less(i, j int) bool
func (ProcessListSortByCPUPercentReverse) Swap ¶
func (s ProcessListSortByCPUPercentReverse) Swap(i, j int)
type ProcessListSortByCreated ¶
type ProcessListSortByCreated []*Process
func (ProcessListSortByCreated) Len ¶
func (s ProcessListSortByCreated) Len() int
func (ProcessListSortByCreated) Less ¶
func (s ProcessListSortByCreated) Less(i, j int) bool
func (ProcessListSortByCreated) Swap ¶
func (s ProcessListSortByCreated) Swap(i, j int)
type ProcessListSortByCreatedReverse ¶
type ProcessListSortByCreatedReverse []*Process
func (ProcessListSortByCreatedReverse) Len ¶
func (s ProcessListSortByCreatedReverse) Len() int
func (ProcessListSortByCreatedReverse) Less ¶
func (s ProcessListSortByCreatedReverse) Less(i, j int) bool
func (ProcessListSortByCreatedReverse) Swap ¶
func (s ProcessListSortByCreatedReverse) Swap(i, j int)
type ProcessListSortByMemPercent ¶
type ProcessListSortByMemPercent []*Process
func (ProcessListSortByMemPercent) Len ¶
func (s ProcessListSortByMemPercent) Len() int
func (ProcessListSortByMemPercent) Less ¶
func (s ProcessListSortByMemPercent) Less(i, j int) bool
func (ProcessListSortByMemPercent) Swap ¶
func (s ProcessListSortByMemPercent) Swap(i, j int)
type ProcessListSortByMemPercentReverse ¶
type ProcessListSortByMemPercentReverse []*Process
func (ProcessListSortByMemPercentReverse) Len ¶
func (s ProcessListSortByMemPercentReverse) Len() int
func (ProcessListSortByMemPercentReverse) Less ¶
func (s ProcessListSortByMemPercentReverse) Less(i, j int) bool
func (ProcessListSortByMemPercentReverse) Swap ¶
func (s ProcessListSortByMemPercentReverse) Swap(i, j int)
type ProcessListSortByNumFDs ¶
type ProcessListSortByNumFDs []*Process
func (ProcessListSortByNumFDs) Len ¶
func (s ProcessListSortByNumFDs) Len() int
func (ProcessListSortByNumFDs) Less ¶
func (s ProcessListSortByNumFDs) Less(i, j int) bool
func (ProcessListSortByNumFDs) Swap ¶
func (s ProcessListSortByNumFDs) Swap(i, j int)
type ProcessListSortByNumFDsReverse ¶
type ProcessListSortByNumFDsReverse []*Process
func (ProcessListSortByNumFDsReverse) Len ¶
func (s ProcessListSortByNumFDsReverse) Len() int
func (ProcessListSortByNumFDsReverse) Less ¶
func (s ProcessListSortByNumFDsReverse) Less(i, j int) bool
func (ProcessListSortByNumFDsReverse) Swap ¶
func (s ProcessListSortByNumFDsReverse) Swap(i, j int)
type ProcessListSortByNumThreads ¶
type ProcessListSortByNumThreads []*Process
func (ProcessListSortByNumThreads) Len ¶
func (s ProcessListSortByNumThreads) Len() int
func (ProcessListSortByNumThreads) Less ¶
func (s ProcessListSortByNumThreads) Less(i, j int) bool
func (ProcessListSortByNumThreads) Swap ¶
func (s ProcessListSortByNumThreads) Swap(i, j int)
type ProcessListSortByNumThreadsReverse ¶
type ProcessListSortByNumThreadsReverse []*Process
func (ProcessListSortByNumThreadsReverse) Len ¶
func (s ProcessListSortByNumThreadsReverse) Len() int
func (ProcessListSortByNumThreadsReverse) Less ¶
func (s ProcessListSortByNumThreadsReverse) Less(i, j int) bool
func (ProcessListSortByNumThreadsReverse) Swap ¶
func (s ProcessListSortByNumThreadsReverse) Swap(i, j int)
type ProcessListSortByPid ¶
type ProcessListSortByPid []*Process
func (ProcessListSortByPid) Len ¶
func (s ProcessListSortByPid) Len() int
func (ProcessListSortByPid) Less ¶
func (s ProcessListSortByPid) Less(i, j int) bool
func (ProcessListSortByPid) Swap ¶
func (s ProcessListSortByPid) Swap(i, j int)
type ProcessListSortByPidReverse ¶
type ProcessListSortByPidReverse []*Process
func (ProcessListSortByPidReverse) Len ¶
func (s ProcessListSortByPidReverse) Len() int
func (ProcessListSortByPidReverse) Less ¶
func (s ProcessListSortByPidReverse) Less(i, j int) bool
func (ProcessListSortByPidReverse) Swap ¶
func (s ProcessListSortByPidReverse) Swap(i, j int)
type RealTimeStatus ¶
type RealTimeStatus struct { CPU TimeSeries Mem TimeSeries Net NetIOTimeSeries Temp map[string]TimeSeries // contains filtered or unexported fields }
RealTimeStatus 实时状态数据结构
func NewRealTimeStatus ¶
func NewRealTimeStatus(cfg *Settings, interval time.Duration, maxSize int) *RealTimeStatus
NewRealTimeStatus 创建实时状态数据结构
func RealTimeStatusObject ¶
func RealTimeStatusObject(n ...int) *RealTimeStatus
RealTimeStatusObject 实时状态
func (*RealTimeStatus) CPUAdd ¶
func (r *RealTimeStatus) CPUAdd(y float64) *RealTimeStatus
func (*RealTimeStatus) Listen ¶
func (r *RealTimeStatus) Listen(ctx context.Context) *RealTimeStatus
Listen 监听
func (*RealTimeStatus) MemAdd ¶
func (r *RealTimeStatus) MemAdd(y float64) *RealTimeStatus
func (*RealTimeStatus) NetAdd ¶
func (r *RealTimeStatus) NetAdd(stat net.IOCountersStat) *RealTimeStatus
func (*RealTimeStatus) SetSettings ¶
func (r *RealTimeStatus) SetSettings(c *Settings, interval time.Duration, max int) *RealTimeStatus
func (*RealTimeStatus) TempAdd ¶
func (r *RealTimeStatus) TempAdd(ts []host.TemperatureStat) *RealTimeStatus
type RuntimeStatus ¶
type RuntimeStatus struct { NumGoroutine int // General statistics. MemAllocated uint64 // bytes allocated and still in use MemTotal uint64 // bytes allocated (even if freed) MemSys uint64 // bytes obtained from system (sum of XxxSys below) Lookups uint64 // number of pointer lookups MemMallocs uint64 // number of mallocs MemFrees uint64 // number of frees // Main allocation heap statistics. HeapAlloc uint64 // bytes allocated and still in use HeapSys uint64 // bytes obtained from system HeapIdle uint64 // bytes in idle spans HeapInuse uint64 // bytes in non-idle span HeapReleased uint64 // bytes released to the OS HeapObjects uint64 // total number of allocated objects // Low-level fixed-size structure allocator statistics. // Inuse is bytes used now. // Sys is bytes obtained from system. StackInuse uint64 // bootstrap stacks StackSys uint64 MSpanInuse uint64 // mspan structures MSpanSys uint64 MCacheInuse uint64 // mcache structures MCacheSys uint64 BuckHashSys uint64 // profiling bucket hash table GCSys uint64 // GC metadata OtherSys uint64 // other system allocations // Garbage collector statistics. NextGC uint64 // next run in HeapAlloc time (bytes) LastGC uint64 // last run in absolute time (ns) PauseTotalNs uint64 PauseNs string // circular buffer of recent GC pause times, most recent at [(NumGC+255)%256] NumGC uint32 }
RuntimeStatus 运行时信息
func (*RuntimeStatus) LastGCString ¶
func (r *RuntimeStatus) LastGCString() string
LastGCString LastGC
func (*RuntimeStatus) PauseTotalNsString ¶
func (r *RuntimeStatus) PauseTotalNsString() string
PauseTotalNsString PauseTotalNs
type Settings ¶
type Settings struct { MonitorOn bool // 是否开启监控 AlarmOn bool // 是否开启告警 AlarmThreshold AlarmThreshold // 告警阀值 ReportEmail string // 如有多个邮箱,则一行一个 }
func NewSettings ¶
func NewSettings() *Settings
type SystemInformation ¶
type SystemInformation struct { CPU []cpu.InfoStat `json:",omitempty"` CPUPercent []float64 `json:",omitempty"` Partitions []disk.PartitionStat `json:",omitempty"` DiskUsages []*disk.UsageStat `json:",omitempty"` DiskIO map[string]disk.IOCountersStat `json:",omitempty"` Host *host.InfoStat `json:",omitempty"` Load *load.AvgStat `json:",omitempty"` Memory *MemoryInformation `json:",omitempty"` NetIO []net.IOCountersStat `json:",omitempty"` Temp []host.TemperatureStat `json:",omitempty"` Go *RuntimeStatus `json:",omitempty"` }
type TimeSeries ¶
type TimeSeries []XY
Click to show internal directories.
Click to hide internal directories.