Documentation ¶
Index ¶
- Variables
- func ListenRealTimeStatus(cfg *Settings)
- func RealTimeStatusIsListening() bool
- type AlarmThreshold
- type DynamicInformation
- type LastTimeValue
- type MemoryInformation
- type NetIOTimeSeries
- 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
- type Settings
- type SystemInformation
- type TimeSeries
- type XY
Constants ¶
This section is empty.
Variables ¶
View Source
var (
CancelRealTimeStatusCollection = func() {}
)
Functions ¶
func ListenRealTimeStatus ¶
func ListenRealTimeStatus(cfg *Settings)
func RealTimeStatusIsListening ¶
func RealTimeStatusIsListening() bool
Types ¶
type AlarmThreshold ¶
type DynamicInformation ¶
type DynamicInformation struct { CPUPercent []float64 Load *load.AvgStat `json:",omitempty"` Memory *MemoryInformation NetIO []net.IOCountersStat `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
type LastTimeValue ¶
type MemoryInformation ¶
type MemoryInformation struct { Virtual *mem.VirtualMemoryStat Swap *mem.SwapMemoryStat }
type NetIOTimeSeries ¶
type NetIOTimeSeries struct { BytesSent TimeSeries BytesRecv TimeSeries PacketsSent TimeSeries PacketsRecv TimeSeries // contains filtered or unexported fields }
func NewNetIOTimeSeries ¶
func NewNetIOTimeSeries() NetIOTimeSeries
type RealTimeStatus ¶
type RealTimeStatus struct { CPU TimeSeries Mem TimeSeries Net NetIOTimeSeries Settings *Settings // contains filtered or unexported fields }
func NewRealTimeStatus ¶
func NewRealTimeStatus(cfg *Settings, interval time.Duration, maxSize int) *RealTimeStatus
func RealTimeStatusObject ¶
func RealTimeStatusObject() *RealTimeStatus
func (*RealTimeStatus) CPUAdd ¶
func (r *RealTimeStatus) CPUAdd(y float64) *RealTimeStatus
func (*RealTimeStatus) Listen ¶
func (r *RealTimeStatus) Listen(ctx context.Context) *RealTimeStatus
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
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 CPUPercent []float64 Partitions []disk.PartitionStat DiskUsages []*disk.UsageStat DiskIO map[string]disk.IOCountersStat Host *host.InfoStat Load *load.AvgStat Memory *MemoryInformation NetIO []net.IOCountersStat }
type TimeSeries ¶
type TimeSeries []XY
Click to show internal directories.
Click to hide internal directories.