Documentation ¶
Index ¶
- Variables
- func AgentMetrics() (L []*model.MetricValue)
- func BuildDynamicMappers()
- func BuildMappers()
- func CalculateProcCpuRate(num uint64) float64
- func CheckCollector()
- func CoreNetMetrics(ifacePrefix []string) []*model.MetricValue
- func CounterValue(metric string, val interface{}, tags ...string) *model.MetricValue
- func CpuGuest() float64
- func CpuGuestByCore(index int) float64
- func CpuIdle() float64
- func CpuIdleByCore(index int) float64
- func CpuIowait() float64
- func CpuIowaitByCore(index int) float64
- func CpuIrq() float64
- func CpuIrqByCore(index int) float64
- func CpuMetrics() []*model.MetricValue
- func CpuNice() float64
- func CpuNiceByCore(index int) float64
- func CpuPrepared() bool
- func CpuSoftIrq() float64
- func CpuSoftIrqByCore(index int) float64
- func CpuSteal() float64
- func CpuStealByCore(index int) float64
- func CpuSystem() float64
- func CpuSystemByCore(index int) float64
- func CpuUser() float64
- func CpuUserByCore(index int) float64
- func CpuValidate(originValue float64) (right float64)
- func CurrentCpuSwitches() uint64
- func DeviceMetrics() (L []*model.MetricValue)
- func DeviceMetricsCheck() bool
- func DiskIOMetrics() (L []*model.MetricValue)
- func DuMetrics() (L []*model.MetricValue)
- func GaugeValue(metric string, val interface{}, tags ...string) *model.MetricValue
- func GetDynamicMetrics() map[string]int
- func GpuMetrics() (L []*model.MetricValue)
- func IODelta(device string, f func([2]*nux.DiskStats) uint64) uint64
- func IOMsecRead(arr [2]*nux.DiskStats) uint64
- func IOMsecTotal(arr [2]*nux.DiskStats) uint64
- func IOMsecWeightedTotal(arr [2]*nux.DiskStats) uint64
- func IOMsecWrite(arr [2]*nux.DiskStats) uint64
- func IOReadMerged(arr [2]*nux.DiskStats) uint64
- func IOReadRequests(arr [2]*nux.DiskStats) uint64
- func IOReadSectors(arr [2]*nux.DiskStats) uint64
- func IOStatsForPage() (L [][]string)
- func IOStatsMetrics() (L []*model.MetricValue)
- func IOWriteMerged(arr [2]*nux.DiskStats) uint64
- func IOWriteRequests(arr [2]*nux.DiskStats) uint64
- func IOWriteSectors(arr [2]*nux.DiskStats) uint64
- func InitMetricsOfFunction()
- func KernelMetrics() (L []*model.MetricValue)
- func LoadAvgMetrics() []*model.MetricValue
- func MemMetrics() []*model.MetricValue
- func NetMetrics() []*model.MetricValue
- func NetstatMetrics() (L []*model.MetricValue)
- func NewMetricValue(metric string, val interface{}, dataType string, tags ...string) *model.MetricValue
- func NtpMetrics() (L []*model.MetricValue)
- func NtpMetricsOld() (L []*model.MetricValue)
- func ParseIoLine(line []byte, this *SingleIOInfo)
- func ParseMemLine(line []byte, pmem *SingleMemInfo)
- func PortMetrics() (L []*model.MetricValue)
- func ProcCpuMetrics(name string, pids []string) []*model.MetricValue
- func ProcIoMetrics(name string, pids []string) []*model.MetricValue
- func ProcMemMetrics(name string, pids []string) []*model.MetricValue
- func ProcMetrics() (L []*model.MetricValue)
- func ProcNetMetrics(service string, pids []string) []*model.MetricValue
- func ProcSsMetrics(service string, pids []string) []*model.MetricValue
- func SetDynamicMappers(mapper []DynamicFuncsAndInterval)
- func SetDynamicMetrics(metrics []string)
- func ShouldHandleDevice(device string) bool
- func SocketStatSummaryMetrics() (L []*model.MetricValue)
- func SysUptimeMetric() (L []*model.MetricValue)
- func TS(arr [2]*nux.DiskStats) uint64
- func Test1() []*model.MetricValue
- func Test2() []*model.MetricValue
- func UdpMetrics() []*model.MetricValue
- func UpdateCpuStat() error
- func UpdateDiskStats() error
- func UpdateProcCpuStat(services map[string][]string) error
- func UrlMetrics() (L []*model.MetricValue)
- type DynamicFuncsAndInterval
- type FuncsAndInterval
- type PidInfo
- type PidNet
- type ProcCpuUsage
- type ProcFuncsAndInterval
- type SSInfo
- type SingleIOInfo
- type SingleMemInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Mappers []FuncsAndInterval ProcMappers []ProcFuncsAndInterval DynamicMappersLock = new(sync.RWMutex) DynamicMappers []DynamicFuncsAndInterval DynamicMappersJson = "" DynamicMapperConfChangeSign = make(chan int) MetricsOfFunctionName = make(map[string]string) ProcMetricsOfFunctionName = make(map[string]string) FunctionNameOfFunction = make(map[string]func() []*model.MetricValue) ProcFunctionNameOfFunction = make(map[string]func(string, []string) []*model.MetricValue) DynamicMetrics = []string{} DynamicMetricsLock = new(sync.RWMutex) )
View Source
var (
ServicesProCpus = make([]map[string]PidInfo, 2)
)
View Source
var USES = map[string]struct{}{
"PruneCalled": {},
"LockDroppedIcmps": {},
"ArpFilter": {},
"TW": {},
"DelayedACKLocked": {},
"ListenOverflows": {},
"ListenDrops": {},
"TCPPrequeueDropped": {},
"TCPTSReorder": {},
"TCPDSACKUndo": {},
"TCPLoss": {},
"TCPLostRetransmit": {},
"TCPLossFailures": {},
"TCPFastRetrans": {},
"TCPFastRetransRate": {},
"TCPTimeouts": {},
"TCPSchedulerFailed": {},
"TCPAbortOnMemory": {},
"TCPAbortOnTimeout": {},
"TCPAbortFailed": {},
"TCPMemoryPressures": {},
"TCPSpuriousRTOs": {},
"TCPBacklogDrop": {},
"TCPMinTTLDrop": {},
}
Functions ¶
func AgentMetrics ¶
func AgentMetrics() (L []*model.MetricValue)
func CalculateProcCpuRate ¶
func CheckCollector ¶
func CheckCollector()
func CoreNetMetrics ¶
func CoreNetMetrics(ifacePrefix []string) []*model.MetricValue
func CounterValue ¶
func CounterValue(metric string, val interface{}, tags ...string) *model.MetricValue
计数器类型
func CpuGuestByCore ¶
func CpuIdleByCore ¶
func CpuIowaitByCore ¶
func CpuIrqByCore ¶
func CpuMetrics ¶
func CpuMetrics() []*model.MetricValue
func CpuNiceByCore ¶
func CpuPrepared ¶
func CpuPrepared() bool
func CpuSoftIrq ¶
func CpuSoftIrq() float64
func CpuSoftIrqByCore ¶
func CpuStealByCore ¶
func CpuSystemByCore ¶
func CpuUserByCore ¶
func CpuValidate ¶
func CurrentCpuSwitches ¶
func CurrentCpuSwitches() uint64
func DeviceMetrics ¶
func DeviceMetrics() (L []*model.MetricValue)
func DeviceMetricsCheck ¶
func DeviceMetricsCheck() bool
func DiskIOMetrics ¶
func DiskIOMetrics() (L []*model.MetricValue)
func DuMetrics ¶
func DuMetrics() (L []*model.MetricValue)
func GaugeValue ¶
func GaugeValue(metric string, val interface{}, tags ...string) *model.MetricValue
原值类型
func GetDynamicMetrics ¶
func IOMsecRead ¶
func IOMsecTotal ¶
func IOMsecWeightedTotal ¶
func IOMsecWrite ¶
func IOReadMerged ¶
func IOReadRequests ¶
func IOReadSectors ¶
func IOStatsForPage ¶
func IOStatsForPage() (L [][]string)
func IOStatsMetrics ¶
func IOStatsMetrics() (L []*model.MetricValue)
func IOWriteMerged ¶
func IOWriteRequests ¶
func IOWriteSectors ¶
func InitMetricsOfFunction ¶
func InitMetricsOfFunction()
func KernelMetrics ¶
func KernelMetrics() (L []*model.MetricValue)
func LoadAvgMetrics ¶
func LoadAvgMetrics() []*model.MetricValue
func MemMetrics ¶
func MemMetrics() []*model.MetricValue
func NetMetrics ¶
func NetMetrics() []*model.MetricValue
func NetstatMetrics ¶
func NetstatMetrics() (L []*model.MetricValue)
func NewMetricValue ¶
func NewMetricValue(metric string, val interface{}, dataType string, tags ...string) *model.MetricValue
采集信息组成metricValue结构
func NtpMetrics ¶
func NtpMetrics() (L []*model.MetricValue)
func NtpMetricsOld ¶
func NtpMetricsOld() (L []*model.MetricValue)
func ParseIoLine ¶
func ParseIoLine(line []byte, this *SingleIOInfo)
func ParseMemLine ¶
func ParseMemLine(line []byte, pmem *SingleMemInfo)
func PortMetrics ¶
func PortMetrics() (L []*model.MetricValue)
func ProcCpuMetrics ¶
func ProcCpuMetrics(name string, pids []string) []*model.MetricValue
进程cpu采集函数
func ProcIoMetrics ¶
func ProcIoMetrics(name string, pids []string) []*model.MetricValue
func ProcMemMetrics ¶
func ProcMemMetrics(name string, pids []string) []*model.MetricValue
func ProcMetrics ¶
func ProcMetrics() (L []*model.MetricValue)
func ProcNetMetrics ¶
func ProcNetMetrics(service string, pids []string) []*model.MetricValue
func ProcSsMetrics ¶
func ProcSsMetrics(service string, pids []string) []*model.MetricValue
func SetDynamicMappers ¶
func SetDynamicMappers(mapper []DynamicFuncsAndInterval)
func SetDynamicMetrics ¶
func SetDynamicMetrics(metrics []string)
func ShouldHandleDevice ¶
func SocketStatSummaryMetrics ¶
func SocketStatSummaryMetrics() (L []*model.MetricValue)
func SysUptimeMetric ¶
func SysUptimeMetric() (L []*model.MetricValue)
func Test1 ¶
func Test1() []*model.MetricValue
func Test2 ¶
func Test2() []*model.MetricValue
func UdpMetrics ¶
func UdpMetrics() []*model.MetricValue
func UpdateCpuStat ¶
func UpdateCpuStat() error
func UpdateDiskStats ¶
func UpdateDiskStats() error
func UpdateProcCpuStat ¶
func UrlMetrics ¶
func UrlMetrics() (L []*model.MetricValue)
Types ¶
type DynamicFuncsAndInterval ¶
type DynamicFuncsAndInterval struct { Fs func() []*model.MetricValue Interval int }
func GetDynamicMappers ¶
func GetDynamicMappers() []DynamicFuncsAndInterval
type FuncsAndInterval ¶
type FuncsAndInterval struct { Fs []func() []*model.MetricValue Interval int }
FuncsAndInterval 拆分不同的采集函数集,方便通过不同goroutine运行
type ProcCpuUsage ¶
type ProcCpuUsage struct { Utime uint64 // time spent in user mode Stime uint64 // time spent in user mode with low priority (nice) Cutime uint64 // 累计的该任务的所有的 waited-for 进程曾经在用户态运行的时间 Cstime uint64 // 累计的该任务的所有的 waited-for 进程曾经在核心态运行的时间 Total uint64 // total of all time fields }
func GetProcCpuStat ¶
func GetProcCpuStat(fName string) (*ProcCpuUsage, error)
type ProcFuncsAndInterval ¶
type ProcFuncsAndInterval struct { Fs []func(string, []string) []*model.MetricValue Interval int }
type SSInfo ¶
type SingleIOInfo ¶
proc argus collect
func GetOnePidIoInfo ¶
func GetOnePidIoInfo(pid string) *SingleIOInfo
Click to show internal directories.
Click to hide internal directories.