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:
type DiskData ¶
type DiskData struct {
Total uint64 `json:"total"`
Used uint64 `json:"used"`
Usage float64 `json:"usage"`
Error string `json:"error"`
}
DiskData @Description:
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:
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
Click to show internal directories.
Click to hide internal directories.