monitor

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CpuData

type CpuData struct {
	Usage   float64 `json:"usage"`
	AppUsed float64 `json:"app_used"`
	Error   string  `json:"error"`
}

CpuData @Description:

func (*CpuData) Collect

func (c *CpuData) Collect() error

Collect @Description: @receiver c @return error

type DiskData

type DiskData struct {
	Total uint64  `json:"total"`
	Used  uint64  `json:"used"`
	Usage float64 `json:"usage"`
	Error string  `json:"error"`
}

DiskData @Description:

func (*DiskData) Collect

func (d *DiskData) Collect() error

Collect @Description: @receiver d @return error

type MemoryData

type MemoryData struct {
	Total     uint64  `json:"total"`
	Used      uint64  `json:"used"`
	Usage     float64 `json:"usage"`
	AppUsed   uint64  `json:"app_used"`
	SwapTotal uint64  `json:"swap_total"`
	SwapUsed  uint64  `json:"swap_used"`
	SwapUsage float64 `json:"swap_usage"`
	Error     string  `json:"error"`
}

MemoryData @Description:

func (*MemoryData) Collect

func (m *MemoryData) Collect() error

Collect @Description: @receiver m

type SystemData

type SystemData struct {
	CPU    CpuData    `json:"cpu"`
	Memory MemoryData `json:"memory"`
	Disk   DiskData   `json:"disk"`
}

SystemData @Description:

func (*SystemData) CollectAll

func (d *SystemData) CollectAll()

CollectAll @Description: @receiver d

type TrafficRecorder

type TrafficRecorder struct {
	// contains filtered or unexported fields
}

TrafficRecorder @Description:

func NewTrafficRecorder

func NewTrafficRecorder() TrafficRecorder

NewTrafficRecorder @Description: @return TrafficRecorder

func (*TrafficRecorder) DumpAndReset

func (r *TrafficRecorder) DumpAndReset(file string) error

DumpAndReset @Description: @receiver r @param file @return error

func (*TrafficRecorder) Latest

func (r *TrafficRecorder) Latest() []TrafficStamp

Latest @Description: @receiver r @return []TrafficStamp

func (*TrafficRecorder) Push

func (r *TrafficRecorder) Push(stamp TrafficStamp)

Push @Description: @receiver r @param stamp

func (*TrafficRecorder) Recent

func (r *TrafficRecorder) Recent(count int) []TrafficStamp

Recent @Description: @receiver r @param count @return []TrafficStamp

type TrafficStamp

type TrafficStamp struct {
	RxFlow    uint64 `json:"rx_flow"`   //接收流量
	TxFlow    uint64 `json:"tx_flow"`   //发送流量
	RxPacket  uint64 `json:"rx_packet"` //数据包接收
	TxPacket  uint64 `json:"tx_packet"` //数据包发送
	Timestamp int64  `json:"timestamp"` //时间戳
}

TrafficStamp @Description:

func CreateTrafficStampWithDuration

func CreateTrafficStampWithDuration(rx, tx *traffic.FlowStatisticsFP, gap int) TrafficStamp

CreateTrafficStampWithDuration @Description: @param rx @param tx @param gap @param slice @return TrafficStamp

Jump to

Keyboard shortcuts

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