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 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 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.