system

package
v2.2.3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2020 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

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 AlarmThreshold struct {
	Memory float64
	CPU    float64
}

type DynamicInformation

type DynamicInformation struct {
	CPUPercent []float64
	Load       *load.AvgStat `json:",omitempty"`
	Memory     *MemoryInformation
	NetIO      []net.IOCountersStat `json:",omitempty"`
}

func (*DynamicInformation) Init

func (*DynamicInformation) MemoryAndCPU

func (d *DynamicInformation) MemoryAndCPU() *DynamicInformation

func (*DynamicInformation) NetMemoryCPU

func (d *DynamicInformation) NetMemoryCPU() *DynamicInformation

type LastTimeValue

type LastTimeValue struct {
	Time  time.Time
	Value float64
}

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 (*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

func (*Settings) FromStore

func (s *Settings) FromStore(h echo.H) *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

type XY

type XY [2]interface{}

func NewXY

func NewXY(y float64) XY

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL