funcs

package
v0.0.0-...-9e2cc1d Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR_SUCCESS        = 0
	ERROR_FILE_NOT_FOUND = 2
	DRIVE_REMOVABLE      = 2
	DRIVE_FIXED          = 3
	HKEY_LOCAL_MACHINE   = 0x80000002
	RRF_RT_REG_SZ        = 0x00000002
	RRF_RT_REG_DWORD     = 0x00000010
	PDH_FMT_LONG         = 0x00000100
	PDH_FMT_DOUBLE       = 0x00000200
	PDH_FMT_LARGE        = 0x00000400
	PDH_INVALID_DATA     = 0xc0000bc6
	PDH_INVALID_HANDLE   = 0xC0000bbc
	PDH_NO_DATA          = 0x800007d5
)

windows system const

Variables

View Source
var (
	Modkernel32 = syscall.NewLazyDLL("kernel32.dll")
	ModNt       = syscall.NewLazyDLL("ntdll.dll")
	ModPdh      = syscall.NewLazyDLL("pdh.dll")

	ProcGetSystemTimes           = Modkernel32.NewProc("GetSystemTimes")
	ProcNtQuerySystemInformation = ModNt.NewProc("NtQuerySystemInformation")
	PdhOpenQuery                 = ModPdh.NewProc("PdhOpenQuery")
	PdhAddCounter                = ModPdh.NewProc("PdhAddCounterW")
	PdhCollectQueryData          = ModPdh.NewProc("PdhCollectQueryData")
	PdhGetFormattedCounterValue  = ModPdh.NewProc("PdhGetFormattedCounterValue")
	PdhCloseQuery                = ModPdh.NewProc("PdhCloseQuery")
)

Functions

func AgentMetrics

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

func BuildMappers

func BuildMappers()

func BytePtrToString

func BytePtrToString(p *uint8) string

borrowed from net/interface_windows.go

func CheckCollector

func CheckCollector()

func CoreNetMetrics

func CoreNetMetrics() []*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

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 CreateQuery

func CreateQuery() (syscall.Handle, error)

func DeviceMetrics

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

func DiskIOMetrics

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

func GaugeValue

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

func LoadMetrics

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

func MemMetrics

func MemMetrics() []*model.MetricValue

func NetMetrics

func NetMetrics() []*model.MetricValue

func NewMetricValue

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

func UpdateCpuStat

func UpdateCpuStat() error

Types

type CounterInfo

type CounterInfo struct {
	PostName    string
	CounterName string
	Counter     syscall.Handle
}

func CreateCounter

func CreateCounter(query syscall.Handle, pname, cname string) (*CounterInfo, error)

type FILETIME

type FILETIME struct {
	DwLowDateTime  uint32
	DwHighDateTime uint32
}

type FuncsAndInterval

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

type PDH_FMT_COUNTERVALUE_DOUBLE

type PDH_FMT_COUNTERVALUE_DOUBLE struct {
	CStatus     uint32
	DoubleValue float64
}

for double values

type PDH_FMT_COUNTERVALUE_LARGE

type PDH_FMT_COUNTERVALUE_LARGE struct {
	CStatus    uint32
	LargeValue int64
}

for 64 bit integer values

type PDH_FMT_COUNTERVALUE_LONG

type PDH_FMT_COUNTERVALUE_LONG struct {
	CStatus   uint32
	LongValue int32
	// contains filtered or unexported fields
}

for long values

Jump to

Keyboard shortcuts

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