Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StateMap = map[string]string{
"R": "running",
"S": "sleeping",
"D": "disk sleep",
"T": "stopped",
"Z": "zombie",
"X": "dead",
}
StateMap is state map
Functions ¶
Types ¶
type CPUStat ¶
type CPUStat struct {
User uint64 `json:"user"`
Nice uint64 `json:"nice"`
System uint64 `json:"system"`
Idle uint64 `json:"idle"`
IOWait uint64 `json:"io_wait"`
IRQ uint64 `json:"irq"`
SoftIRQS uint64 `json:"soft_irqs"`
Steal uint64 `json:"steal"`
Guest uint64 `json:"guest"`
GuestNice uint64 `json:"guest_nice"`
UserRate float64 `json:"user_rate"`
SystemRate float64 `json:"system_rate"`
IdleRate float64 `json:"idle_rate"`
IOWaitRate float64 `json:"io_wait_rate"`
}
CPUStat storing cpu stat
type DiskStat ¶
type DiskStat struct {
Label string `json:"label"`
Mount string `json:"mount"`
Total uint64 `json:"total"`
Used uint64 `json:"used"`
Free uint64 `json:"free"`
UsedRate float64 `json:"used_rate"`
}
DiskStat storing disk stat
func GetDiskStat ¶
GetDiskStat returns all disk stat
type HostInfo ¶
type HostInfo struct {
HostName string `json:"host_name"`
OSType string `json:"os_type"`
OSRelease string `json:"os_release"`
Version string `json:"version"`
Release string `json:"release"`
OSBit string `json:"os_bit"`
}
HostInfo storing host info
type IOStat ¶
type IOStat struct {
Major uint64 `json:"major"` // major device number
Minor uint64 `json:"minor"` // minor device number
Name string `json:"name"` // device name
ReadIOs uint64 `json:"read_ios"` // r/s total number of reads
ReadMerges uint64 `json:"read_merges"` // rrqm/s number of read I/Os merged with in-queue I/O
ReadSectors uint64 `json:"read_sectors"` // rsec/s number of 512 byte sectors read
ReadTicks uint64 `json:"read_ticks"` // number of milliseconds spent reading
WriteIOs uint64 `json:"write_ios"` // w/s total number of writes
WriteMerges uint64 `json:"write_merges"` // wrqm/s number of write I/Os merged with in-queue I/O
WriteSectors uint64 `json:"write_sectors"` // wsec/s number of 512 byte sectors written
WriteTicks uint64 `json:"write_ticks"` // number of milliseconds spent writing
InFlight uint64 `json:"in_flight"` // number of I/Os currently in progress
IOTicks uint64 `json:"io_ticks"` // number of milliseconds spent doing I/Os(in flight)
TimeInQueue uint64 `json:"time_in_queue"` // total wait time for all requests in milliseconds
ReadBytes uint64 `json:"read_bytes"` // rB/s
WriteBytes uint64 `json:"write_bytes"` // wB/s
}
IOStat storing io stat
type LoadStat ¶
type LoadStat struct {
LoadNow float64 `json:"load_now"`
LoadPre float64 `json:"load_pre"`
LoadFar float64 `json:"load_far"`
ProcessTotal uint64 `json:"process_total"`
ProcessRun uint64 `json:"process_run"`
ProcessIdle uint64 `json:"process_idle"`
}
LoadStat storing load stat
type MemStat ¶
type MemStat struct {
MemTotal uint64 `json:"mem_total"`
MemUsed uint64 `json:"mem_used"`
MemFree uint64 `json:"mem_free"`
Buffers uint64 `json:"buffers"`
Cached uint64 `json:"cached"`
SwapTotal uint64 `json:"swap_total"`
SwapUsed uint64 `json:"swap_used"`
SwapFree uint64 `json:"swap_free"`
MemRate float64 `json:"mem_rate"`
SwapRate float64 `json:"swap_rate"`
}
MemStat storing memory stat
type NetStat ¶
type NetStat struct {
Device string `json:"device"`
RXBytes uint64 `json:"rx_bytes"`
RXPackets uint64 `json:"rx_packets"`
RXErrs uint64 `json:"rx_errs"`
RXDrop uint64 `json:"rx_drop"`
RXFifo uint64 `json:"rx_fifo"`
RXFrame uint64 `json:"rx_frame"`
RXCompressed uint64 `json:"rx_compressed"`
RXMulticast uint64 `json:"rx_multicase"`
TXBytes uint64 `json:"tx_bytes"`
TXPackets uint64 `json:"tx_packetss"`
TXErrs uint64 `json:"tx_errs"`
TXDrop uint64 `json:"tx_drop"`
TXFifo uint64 `json:"tx_fifo"`
TXColls uint64 `json:"tx_colls"`
TXCarrier uint64 `json:"tx_carrier"`
TXCompressed uint64 `json:"tx_compressed"`
}
NetStat storing net stat
type ProcessStat ¶
type ProcessStat struct {
Pid int `json:"pid"`
Name string `json:"name"`
State string `json:"state"`
}
ProcessStat storing process stat
func GetProcessStat ¶
func GetProcessStat() (stat []ProcessStat, err error)
GetProcessStat returns process stat
type UptimeStat ¶
type UptimeStat struct {
Uptime float64 `json:"uptime"`
IdleTime float64 `json:"idle_time"`
IdleRate float64 `json:"idle_rate"`
}
UptimeStat storing uptime stat
func GetUptimeStat ¶
func GetUptimeStat() (stat UptimeStat, err error)
GetUptimeStat returns uptime stat
Click to show internal directories.
Click to hide internal directories.