funcs

package
v0.0.0-...-81b9c09 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var USES = map[string]struct{}{
	"PruneCalled":        struct{}{},
	"LockDroppedIcmps":   struct{}{},
	"ArpFilter":          struct{}{},
	"TW":                 struct{}{},
	"DelayedACKLocked":   struct{}{},
	"ListenOverflows":    struct{}{},
	"ListenDrops":        struct{}{},
	"TCPPrequeueDropped": struct{}{},
	"TCPTSReorder":       struct{}{},
	"TCPDSACKUndo":       struct{}{},
	"TCPLoss":            struct{}{},
	"TCPLostRetransmit":  struct{}{},
	"TCPLossFailures":    struct{}{},
	"TCPFastRetrans":     struct{}{},
	"TCPTimeouts":        struct{}{},
	"TCPSchedulerFailed": struct{}{},
	"TCPAbortOnMemory":   struct{}{},
	"TCPAbortOnTimeout":  struct{}{},
	"TCPAbortFailed":     struct{}{},
	"TCPMemoryPressures": struct{}{},
	"TCPSpuriousRTOs":    struct{}{},
	"TCPBacklogDrop":     struct{}{},
	"TCPMinTTLDrop":      struct{}{},
}

Functions

func AgentMetrics

func AgentMetrics() []*model.MetricValue

获取Agent的状态: 能访问,就只有一个状态"活着"

func BuildMappers

func BuildMappers()

关注每个package内部和package同名的go文件,它代表了整个package的"入口"

func CheckCollector

func CheckCollector()

检查各种 Collector是否正常工作? 输出结果: fmt.Println 到控制台

func CoreNetMetrics

func CoreNetMetrics(ifacePrefix []string) []*model.MetricValue

获取指定"前缀"的网卡的信息

func CounterValue

func CounterValue(metric string, val interface{}, tags ...string) *model.MetricValue

计数

func CpuGuest

func CpuGuest() float64

func CpuIdle

func CpuIdle() float64

func CpuIowait

func CpuIowait() float64

func CpuIrq

func CpuIrq() float64

func CpuMetrics

func CpuMetrics() []*model.MetricValue

定义各种CPU Metrics

func CpuNice

func CpuNice() float64

func CpuPrepared

func CpuPrepared() bool

func CpuSoftIrq

func CpuSoftIrq() float64

func CpuSteal

func CpuSteal() float64

func CpuSystem

func CpuSystem() float64

func CpuUser

func CpuUser() float64

func CurrentCpuSwitches

func CurrentCpuSwitches() uint64

func DeviceMetrics

func DeviceMetrics() (L []*model.MetricValue)

获取磁盘信息: /proc/mounts

func DiskIOMetrics

func DiskIOMetrics() (L []*model.MetricValue)

func DuMetrics

func DuMetrics() (L []*model.MetricValue)

统计给定路径的Du,大小为byte

func GaugeValue

func GaugeValue(metric string, val interface{}, tags ...string) *model.MetricValue

测量

func IODelta

func IODelta(device string, f func([2]*nux.DiskStats) uint64) uint64

func IOMsecRead

func IOMsecRead(arr [2]*nux.DiskStats) uint64

func IOMsecTotal

func IOMsecTotal(arr [2]*nux.DiskStats) uint64

func IOMsecWeightedTotal

func IOMsecWeightedTotal(arr [2]*nux.DiskStats) uint64

func IOMsecWrite

func IOMsecWrite(arr [2]*nux.DiskStats) uint64

func IOReadMerged

func IOReadMerged(arr [2]*nux.DiskStats) uint64

func IOReadRequests

func IOReadRequests(arr [2]*nux.DiskStats) uint64

func IOReadSectors

func IOReadSectors(arr [2]*nux.DiskStats) uint64

func IOStatsForPage

func IOStatsForPage() (L [][]string)

func IOStatsMetrics

func IOStatsMetrics() (L []*model.MetricValue)

func IOWriteMerged

func IOWriteMerged(arr [2]*nux.DiskStats) uint64

func IOWriteRequests

func IOWriteRequests(arr [2]*nux.DiskStats) uint64

func IOWriteSectors

func IOWriteSectors(arr [2]*nux.DiskStats) uint64

func KernelMetrics

func KernelMetrics() (L []*model.MetricValue)

KernelMetrics:

    maxfiles
    maxproc
	   allocated (files)

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

func PortMetrics

func PortMetrics() (L []*model.MetricValue)

func ProcMetrics

func ProcMetrics() (L []*model.MetricValue)

func ShouldHandleDevice

func ShouldHandleDevice(device string) bool

func SocketStatSummaryMetrics

func SocketStatSummaryMetrics() (L []*model.MetricValue)

socket的相关统计?

func TS

func TS(arr [2]*nux.DiskStats) uint64

func UdpMetrics

func UdpMetrics() []*model.MetricValue

func UpdateCpuStat

func UpdateCpuStat() error

func UpdateDiskStats

func UpdateDiskStats() error

磁盘统计: 主要是io相关的,而dfstat主要是容量、使用量相关的

Types

type FuncsAndInterval

type FuncsAndInterval struct {
	Fs       []func() []*model.MetricValue
	Interval int
}

Jump to

Keyboard shortcuts

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