Documentation ¶
Index ¶
- Variables
- func AgentMetrics() []*model.MetricValue
- func BuildMappers()
- func CheckCollector()
- func CoreNetMetrics(ifacePrefix []string) (L []*model.MetricValue)
- func CounterValue(metric string, val interface{}, tags ...string) *model.MetricValue
- func CpuIdle() float64
- func CpuMetrics() []*model.MetricValue
- func CpuPrepared() bool
- func CpuSystem() float64
- func CpuUser() float64
- func DeviceMetrics() (L []*model.MetricValue)
- func DiskIOMetrics() (L []*model.MetricValue)
- func GaugeValue(metric string, val interface{}, tags ...string) *model.MetricValue
- func IOCounters() (map[string]diskIOCounter, error)
- func IsTCPPortUsed(port int64) bool
- func MemMetrics() []*model.MetricValue
- func NetMetrics() []*model.MetricValue
- func NewMetricValue(metric string, val interface{}, dataType string, tags ...string) *model.MetricValue
- func PortMetrics() (L []*model.MetricValue)
- func ProcMetrics() (L []*model.MetricValue)
- func TcpipMetrics() (L []*model.MetricValue)
- func UpdateCpuStat() error
- type CPUTimesStat
- type FILETIME
- type FuncsAndInterval
- type P
- type Tcpipdatastat
- type Win32_PerfFormattedData
- type Win32_PerfFormattedData_IDLE
- type Win32_PerfRawData_W3SVC_WebService
- type Win32_Processor
- type Win32_TCPPerfFormattedData
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 Mappers []FuncsAndInterval
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 CoreNetMetrics ¶
func CoreNetMetrics(ifacePrefix []string) (L []*model.MetricValue)
func CounterValue ¶
func CounterValue(metric string, val interface{}, tags ...string) *model.MetricValue
func CpuMetrics ¶
func CpuMetrics() []*model.MetricValue
func CpuPrepared ¶
func CpuPrepared() bool
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 IsTCPPortUsed ¶
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 FuncsAndInterval ¶
type FuncsAndInterval struct { Fs []func() []*model.MetricValue Interval int }
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 ¶
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 }
func IIsCounters ¶
func IIsCounters() ([]Win32_PerfRawData_W3SVC_WebService, error)
type Win32_Processor ¶
Click to show internal directories.
Click to hide internal directories.