Documentation

Index

Constants

This section is empty.

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")
)
View Source
var MsSQL_Mertics = map[string]string{
	"Errors/sec":                "GUAGE",
	"Target_Server_Memory_(KB)": "GUAGE",
	"Total_Server_Memory_(KB)":  "GUAGE",
	"Batch_Requests/sec":        "GUAGE",
}
View Source
var MsSQL_Mertics_instance = map[string]string{
	"Lock_Waits/sec":             "GUAGE",
	"Average_Wait_Time_(ms)":     "GUAGE",
	"Log_File(s)_Size_(KB)":      "GUAGE",
	"Log_File(s)_Used_Size_(KB)": "GUAGE",
	"Percent_Log_Used":           "GUAGE",
}

Functions

func AgentMetrics

func AgentMetrics() []*model.MetricValue

func BuildMappers

func BuildMappers()

func CheckCollector

func CheckCollector()

func CheckTCPPortUsed

func CheckTCPPortUsed(port int64) bool

func CoreNetMetrics

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

func CounterValue

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

func CpuIdle

func CpuIdle() float64

func CpuMetrics

func CpuMetrics() []*model.MetricValue

func CpuPrepared

func CpuPrepared() bool

func CpuSystem

func CpuSystem() float64

func CpuUser

func CpuUser() float64

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 IOCounters

func IOCounters() (map[string]diskIOCounter, error)

func IsTCPPortUsed

func IsTCPPortUsed(addr string, port int64) bool

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 PortMetrics

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

func ProcMetrics

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

func TcpipMetrics

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

func UpdateCpuStat

func UpdateCpuStat() error

Types

type CPUTimesStat

type CPUTimesStat struct {
	User   float64 `json:"user"`
	System float64 `json:"system"`
	Idle   float64 `json:"idle"`
	Total  float64 `json:"total"`
}

func CPUTimes

func CPUTimes(percpu bool) ([]CPUTimesStat, error)

type FILETIME

type FILETIME struct {
	DwLowDateTime  uint32
	DwHighDateTime uint32
}

type FuncsAndInterval

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

type P

type P struct {
	// contains filtered or unexported fields
}

func Processes

func Processes() ([]P, error)

type Tcpipdatastat

type Tcpipdatastat struct {
	ConFailures    uint64 `json:"confailures"`
	ConActive      uint64 `json:"conactive"`
	ConPassive     uint64 `json:"conpassive"`
	ConEstablished uint64 `json:"conestablished"`
	ConReset       uint64 `json:"conreset"`
}

func TcpipCounters

func TcpipCounters() ([]Tcpipdatastat, error)

type Win32_PerfFormattedData

type Win32_PerfFormattedData struct {
	AvgDiskSecPerRead_Base  uint32
	AvgDiskSecPerWrite_Base uint32
	DiskReadBytesPerSec     uint64
	DiskReadsPerSec         uint32
	DiskWriteBytesPerSec    uint64
	DiskWritesPerSec        uint32
	Name                    string
}

func PerfFormattedData

func PerfFormattedData() ([]Win32_PerfFormattedData, error)

type Win32_PerfFormattedData_IDLE

type Win32_PerfFormattedData_IDLE struct {
	Name            string
	PercentIdleTime uint64
}

func PerfFormattedData_IDLE

func PerfFormattedData_IDLE() ([]Win32_PerfFormattedData_IDLE, error)

type Win32_PerfRawData_W3SVC_WebService

type Win32_PerfRawData_W3SVC_WebService struct {
	BytesReceivedPersec          uint64
	BytesSentPersec              uint64
	CGIRequestsPersec            uint32
	ConnectionAttemptsPersec     uint32
	CopyRequestsPersec           uint32
	CurrentConnections           uint32
	DeleteRequestsPersec         uint32
	GetRequestsPersec            uint32
	HeadRequestsPersec           uint32
	ISAPIExtensionRequestsPersec uint32
	LockRequestsPersec           uint32
	LockedErrorsPersec           uint32
	MkcolRequestsPersec          uint32
	MoveRequestsPersec           uint32
	Name                         string
	NotFoundErrorsPersec         uint32
	OptionsRequestsPersec        uint32
	PostRequestsPersec           uint32
	PropfindRequestsPersec       uint32
	ProppatchRequestsPersec      uint32
	PutRequestsPersec            uint32
	SearchRequestsPersec         uint32
	TraceRequestsPersec          uint32
	UnlockRequestsPersec         uint32
	ServiceUptime                uint32
}

type Win32_Processor

type Win32_Processor struct {
	LoadPercentage            *uint16
	Family                    uint16
	Manufacturer              string
	Name                      string
	NumberOfLogicalProcessors uint32
	ProcessorId               *string
	Stepping                  *string
	MaxClockSpeed             uint32
}

type Win32_TCPPerfFormattedData

type Win32_TCPPerfFormattedData struct {
	ConnectionFailures     uint64
	ConnectionsActive      uint64
	ConnectionsPassive     uint64
	ConnectionsEstablished uint64
	ConnectionsReset       uint64
}