Documentation ¶
Index ¶
- Constants
- func GetDiskDevices() ([]string, error)
- func GetNetworkInterfacesInfo() ([]map[string]string, error)
- func GetPartitions() ([]disk.PartitionStat, error)
- func GetProcessesData() ([]agentintegration.ProcessData, error)
- type BaseStatProvider
- type CoreCPUStatPrivider
- func (sc *CoreCPUStatPrivider) CheckRecord(data []string, filter StatProviderFilter) bool
- func (sc *CoreCPUStatPrivider) GetAverageRecord(records [][]string) []string
- func (sc *CoreCPUStatPrivider) GetCode() string
- func (sc *CoreCPUStatPrivider) GetFieldsCount() int
- func (sc *CoreCPUStatPrivider) GetRecord() ([]string, error)
- type DiskIOStatProvider
- func (m *DiskIOStatProvider) CheckRecord(data []string, filter StatProviderFilter) bool
- func (m *DiskIOStatProvider) GetAverageRecord(records [][]string) []string
- func (m *DiskIOStatProvider) GetCode() string
- func (m *DiskIOStatProvider) GetFieldsCount() int
- func (m *DiskIOStatProvider) GetRecord() ([]string, error)
- type DiskUsageStatProvider
- func (m *DiskUsageStatProvider) CheckRecord(data []string, filter StatProviderFilter) bool
- func (m *DiskUsageStatProvider) GetAverageRecord(records [][]string) []string
- func (m *DiskUsageStatProvider) GetCode() string
- func (m *DiskUsageStatProvider) GetDiskInfo() (map[string]map[string]string, error)
- func (m *DiskUsageStatProvider) GetEmptyRecordValue(index int) string
- func (m *DiskUsageStatProvider) GetFieldsCount() int
- func (m *DiskUsageStatProvider) GetRecord() ([]string, error)
- type IOMeasure
- type OverallCPUStatPrivider
- func (sc *OverallCPUStatPrivider) CheckRecord(data []string, filter StatProviderFilter) bool
- func (sc *OverallCPUStatPrivider) GetAverageRecord(records [][]string) []string
- func (sc *OverallCPUStatPrivider) GetCode() string
- func (sc *OverallCPUStatPrivider) GetFieldsCount() int
- func (sc *OverallCPUStatPrivider) GetRecord() ([]string, error)
- type OverallNetworkStatProvider
- func (n *OverallNetworkStatProvider) CheckRecord(data []string, filter StatProviderFilter) bool
- func (n *OverallNetworkStatProvider) GetAverageRecord(records [][]string) []string
- func (n *OverallNetworkStatProvider) GetCode() string
- func (n *OverallNetworkStatProvider) GetFieldsCount() int
- func (n *OverallNetworkStatProvider) GetRecord() ([]string, error)
- type StatCleanerService
- type StatCollector
- func GetCoreCpuStatCollectors() ([]*StatCollector, error)
- func GetDiskIOStatCollectors() ([]*StatCollector, error)
- func GetDiskUsageStatCollector() (*StatCollector, error)
- func GetStatCollector(provider StatProvider) (*StatCollector, error)
- func GetStatCollectors(providers []StatProvider) ([]*StatCollector, error)
- type StatCollectorService
- type StatProvider
- type StatProviderFilter
- type StatProviderTimeFilter
- type SwapMemoryStatPrivider
- func (m *SwapMemoryStatPrivider) CheckRecord(data []string, filter StatProviderFilter) bool
- func (m *SwapMemoryStatPrivider) GetAverageRecord(records [][]string) []string
- func (m *SwapMemoryStatPrivider) GetCode() string
- func (m *SwapMemoryStatPrivider) GetFieldsCount() int
- func (m *SwapMemoryStatPrivider) GetRecord() ([]string, error)
- type VirtualMemoryStatPrivider
- func (m *VirtualMemoryStatPrivider) CheckRecord(data []string, filter StatProviderFilter) bool
- func (m *VirtualMemoryStatPrivider) GetAverageRecord(records [][]string) []string
- func (m *VirtualMemoryStatPrivider) GetCode() string
- func (m *VirtualMemoryStatPrivider) GetFieldsCount() int
- func (m *VirtualMemoryStatPrivider) GetRecord() ([]string, error)
Constants ¶
View Source
const ( OVERALL_CPU_PROVIDER_CODE = "cpuoverall" CORE_CPU_PROVIDER_CODE = "cpucore" VIRTUAL_MEMORY_PROVIDER_CODE = "memoryvirtual" SWAP_MEMORY_PROVIDER_CODE = "memoryswap" DISK_USAGE_PROVIDER_CODE = "diskusage" DISK_IO_PROVIDER_CODE = "diskio" OVERALL_NETWORK_PROVIDER_CODE = "networkoverall" )
View Source
const ( DEFAULT_COLLECT_INTERVALL = time.Minute DEFAULT_CLEAN_INTERVALL = time.Hour * 24 DEFAULT_MAX_COLLECT_PERIOD = 6 // month )
Variables ¶
This section is empty.
Functions ¶
func GetDiskDevices ¶
func GetPartitions ¶
func GetPartitions() ([]disk.PartitionStat, error)
func GetProcessesData ¶
func GetProcessesData() ([]agentintegration.ProcessData, error)
Types ¶
type BaseStatProvider ¶ added in v0.2.1
type BaseStatProvider struct{}
func (*BaseStatProvider) GetEmptyRecordValue ¶ added in v0.2.1
func (p *BaseStatProvider) GetEmptyRecordValue(index int) string
type CoreCPUStatPrivider ¶
type CoreCPUStatPrivider struct { BaseStatProvider CoreNum int }
CoreCPUStatPrivider retrieves statistics data for cpu per core
func (*CoreCPUStatPrivider) CheckRecord ¶ added in v0.2.1
func (sc *CoreCPUStatPrivider) CheckRecord(data []string, filter StatProviderFilter) bool
func (*CoreCPUStatPrivider) GetAverageRecord ¶ added in v0.2.1
func (sc *CoreCPUStatPrivider) GetAverageRecord(records [][]string) []string
func (*CoreCPUStatPrivider) GetCode ¶
func (sc *CoreCPUStatPrivider) GetCode() string
func (*CoreCPUStatPrivider) GetFieldsCount ¶ added in v0.2.1
func (sc *CoreCPUStatPrivider) GetFieldsCount() int
func (*CoreCPUStatPrivider) GetRecord ¶ added in v0.2.1
func (sc *CoreCPUStatPrivider) GetRecord() ([]string, error)
type DiskIOStatProvider ¶
type DiskIOStatProvider struct { BaseStatProvider Device string }
DiskIOStatProvider retrieves statistics data for the disk IO
func (*DiskIOStatProvider) CheckRecord ¶ added in v0.2.1
func (m *DiskIOStatProvider) CheckRecord(data []string, filter StatProviderFilter) bool
func (*DiskIOStatProvider) GetAverageRecord ¶ added in v0.2.1
func (m *DiskIOStatProvider) GetAverageRecord(records [][]string) []string
func (*DiskIOStatProvider) GetCode ¶
func (m *DiskIOStatProvider) GetCode() string
func (*DiskIOStatProvider) GetFieldsCount ¶ added in v0.2.1
func (m *DiskIOStatProvider) GetFieldsCount() int
func (*DiskIOStatProvider) GetRecord ¶ added in v0.2.1
func (m *DiskIOStatProvider) GetRecord() ([]string, error)
type DiskUsageStatProvider ¶
type DiskUsageStatProvider struct { BaseStatProvider Mapper *diskService.MountpointIDMapper }
DiskUsageStatProvider retrieves statistics data for the disk usage
func (*DiskUsageStatProvider) CheckRecord ¶ added in v0.2.1
func (m *DiskUsageStatProvider) CheckRecord(data []string, filter StatProviderFilter) bool
func (*DiskUsageStatProvider) GetAverageRecord ¶ added in v0.2.1
func (m *DiskUsageStatProvider) GetAverageRecord(records [][]string) []string
func (*DiskUsageStatProvider) GetCode ¶
func (m *DiskUsageStatProvider) GetCode() string
func (*DiskUsageStatProvider) GetDiskInfo ¶
func (m *DiskUsageStatProvider) GetDiskInfo() (map[string]map[string]string, error)
func (*DiskUsageStatProvider) GetEmptyRecordValue ¶ added in v0.2.1
func (m *DiskUsageStatProvider) GetEmptyRecordValue(index int) string
func (*DiskUsageStatProvider) GetFieldsCount ¶ added in v0.2.1
func (m *DiskUsageStatProvider) GetFieldsCount() int
func (*DiskUsageStatProvider) GetRecord ¶ added in v0.2.1
func (m *DiskUsageStatProvider) GetRecord() ([]string, error)
type IOMeasure ¶
type IOMeasure struct { ReadCount, WriteCount, MergedReadCount, MergedWriteCount, ReadTime, WriteTime, IoTime, ReadBytes, WriteBytes uint64 }
type OverallCPUStatPrivider ¶
type OverallCPUStatPrivider struct {
BaseStatProvider
}
OverallCPUStatPrivider retrieves overall statistics data for cpu
func (*OverallCPUStatPrivider) CheckRecord ¶ added in v0.2.1
func (sc *OverallCPUStatPrivider) CheckRecord(data []string, filter StatProviderFilter) bool
func (*OverallCPUStatPrivider) GetAverageRecord ¶ added in v0.2.1
func (sc *OverallCPUStatPrivider) GetAverageRecord(records [][]string) []string
func (*OverallCPUStatPrivider) GetCode ¶
func (sc *OverallCPUStatPrivider) GetCode() string
func (*OverallCPUStatPrivider) GetFieldsCount ¶ added in v0.2.1
func (sc *OverallCPUStatPrivider) GetFieldsCount() int
func (*OverallCPUStatPrivider) GetRecord ¶ added in v0.2.1
func (sc *OverallCPUStatPrivider) GetRecord() ([]string, error)
type OverallNetworkStatProvider ¶
type OverallNetworkStatProvider struct {
BaseStatProvider
}
OverallNetworkStatProvider retrieves statistics data for the network usage
func (*OverallNetworkStatProvider) CheckRecord ¶ added in v0.2.1
func (n *OverallNetworkStatProvider) CheckRecord(data []string, filter StatProviderFilter) bool
func (*OverallNetworkStatProvider) GetAverageRecord ¶ added in v0.2.1
func (n *OverallNetworkStatProvider) GetAverageRecord(records [][]string) []string
func (*OverallNetworkStatProvider) GetCode ¶
func (n *OverallNetworkStatProvider) GetCode() string
func (*OverallNetworkStatProvider) GetFieldsCount ¶ added in v0.2.1
func (n *OverallNetworkStatProvider) GetFieldsCount() int
func (*OverallNetworkStatProvider) GetRecord ¶ added in v0.2.1
func (n *OverallNetworkStatProvider) GetRecord() ([]string, error)
type StatCleanerService ¶ added in v0.3.0
type StatCleanerService struct {
// contains filtered or unexported fields
}
func GetStatCleanerService ¶ added in v0.3.0
func GetStatCleanerService() (*StatCleanerService, error)
func (*StatCleanerService) Run ¶ added in v0.3.0
func (s *StatCleanerService) Run() error
type StatCollector ¶
type StatCollector struct { Provider StatProvider FilePath string // contains filtered or unexported fields }
func GetCoreCpuStatCollectors ¶
func GetCoreCpuStatCollectors() ([]*StatCollector, error)
func GetDiskIOStatCollectors ¶
func GetDiskIOStatCollectors() ([]*StatCollector, error)
func GetDiskUsageStatCollector ¶
func GetDiskUsageStatCollector() (*StatCollector, error)
func GetStatCollector ¶
func GetStatCollector(provider StatProvider) (*StatCollector, error)
func GetStatCollectors ¶
func GetStatCollectors(providers []StatProvider) ([]*StatCollector, error)
func (*StatCollector) Clean ¶ added in v0.3.0
func (sc *StatCollector) Clean(filter StatProviderFilter) error
func (*StatCollector) Collect ¶
func (sc *StatCollector) Collect() error
func (*StatCollector) Load ¶
func (sc *StatCollector) Load(filter StatProviderFilter) ([][]string, error)
type StatCollectorService ¶ added in v0.3.0
type StatCollectorService struct {
// contains filtered or unexported fields
}
func GetStatCollectorService ¶ added in v0.3.0
func GetStatCollectorService() (*StatCollectorService, error)
func (*StatCollectorService) Run ¶ added in v0.3.0
func (s *StatCollectorService) Run() error
type StatProvider ¶
type StatProvider interface { GetRecord() ([]string, error) GetCode() string CheckRecord([]string, StatProviderFilter) bool GetFieldsCount() int GetAverageRecord([][]string) []string GetEmptyRecordValue(index int) string }
func GetCoreCpuStatProviders ¶
func GetCoreCpuStatProviders() ([]StatProvider, error)
GetCoreCpuStatProviders creates statistics providers for cpu cores
func GetDiskUsageStatProvider ¶
func GetDiskUsageStatProvider() (StatProvider, error)
type StatProviderFilter ¶
type StatProviderTimeFilter ¶
type StatProviderTimeFilter struct {
FromTime, ToTime int
}
func (*StatProviderTimeFilter) Check ¶
func (f *StatProviderTimeFilter) Check(row []string) bool
func (*StatProviderTimeFilter) GetFromTime ¶ added in v0.2.1
func (f *StatProviderTimeFilter) GetFromTime() int
func (*StatProviderTimeFilter) GetToTime ¶ added in v0.2.1
func (f *StatProviderTimeFilter) GetToTime() int
type SwapMemoryStatPrivider ¶
type SwapMemoryStatPrivider struct {
BaseStatProvider
}
SwapMemoryStatPrivider retrieves statistics data for memory
func (*SwapMemoryStatPrivider) CheckRecord ¶ added in v0.2.1
func (m *SwapMemoryStatPrivider) CheckRecord(data []string, filter StatProviderFilter) bool
func (*SwapMemoryStatPrivider) GetAverageRecord ¶ added in v0.2.1
func (m *SwapMemoryStatPrivider) GetAverageRecord(records [][]string) []string
func (*SwapMemoryStatPrivider) GetCode ¶
func (m *SwapMemoryStatPrivider) GetCode() string
func (*SwapMemoryStatPrivider) GetFieldsCount ¶ added in v0.2.1
func (m *SwapMemoryStatPrivider) GetFieldsCount() int
func (*SwapMemoryStatPrivider) GetRecord ¶ added in v0.2.1
func (m *SwapMemoryStatPrivider) GetRecord() ([]string, error)
type VirtualMemoryStatPrivider ¶
type VirtualMemoryStatPrivider struct {
BaseStatProvider
}
VirtualMemoryStatPrivider retrieves statistics data for memory
func (*VirtualMemoryStatPrivider) CheckRecord ¶ added in v0.2.1
func (m *VirtualMemoryStatPrivider) CheckRecord(data []string, filter StatProviderFilter) bool
func (*VirtualMemoryStatPrivider) GetAverageRecord ¶ added in v0.2.1
func (m *VirtualMemoryStatPrivider) GetAverageRecord(records [][]string) []string
func (*VirtualMemoryStatPrivider) GetCode ¶
func (m *VirtualMemoryStatPrivider) GetCode() string
func (*VirtualMemoryStatPrivider) GetFieldsCount ¶ added in v0.2.1
func (m *VirtualMemoryStatPrivider) GetFieldsCount() int
func (*VirtualMemoryStatPrivider) GetRecord ¶ added in v0.2.1
func (m *VirtualMemoryStatPrivider) GetRecord() ([]string, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.