Documentation
¶
Index ¶
- Constants
- func Init()
- func Start()
- func Stop()
- type CpuMetric
- type DiskIOMeta
- type DiskIOMetric
- type GuestMetrics
- type MemMetric
- type NetIOMetric
- type NetMeta
- type SGuestMonitor
- func (m *SGuestMonitor) Cpu() *CpuMetric
- func (m *SGuestMonitor) Diskio() *DiskIOMetric
- func (m *SGuestMonitor) GetSriovNicStats(pfName string, virtfn int) (*psnet.IOCountersStat, error)
- func (m *SGuestMonitor) Mem() *MemMetric
- func (m *SGuestMonitor) Netio() []*NetIOMetric
- func (m *SGuestMonitor) SetNicDown(index int)
- func (m *SGuestMonitor) UpdateCpuCount(vcpuCount int)
- func (m *SGuestMonitor) UpdateNicsDesc(nics []*desc.SGuestNetwork)
- func (m *SGuestMonitor) UpdateVmName(name string)
- type SGuestMonitorCollector
- type SHostMetricsCollector
Constants ¶
View Source
const (
TelegrafServer = "http://127.0.0.1:8087/write"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CpuMetric ¶
type CpuMetric struct { UsageActive float64 `json:"usage_active"` CpuUsageIdlePcore float64 `json:"cpu_usage_idle_pcore"` CpuUsagePcore float64 `json:"cpu_usage_pcore"` CpuTimeUser float64 `json:"cpu_time_user"` CpuTimeSystem float64 `json:"cpu_time_system"` CpuCount int `json:"cpu_count"` ThreadCount int32 `json:"thread_count"` }
type DiskIOMeta ¶
type DiskIOMeta struct {
Uptime uint64 `json:"uptime"`
}
type DiskIOMetric ¶
type DiskIOMetric struct { Meta DiskIOMeta `json:"-"` ReadBytes uint64 `json:"read_bytes"` WriteBytes uint64 `json:"write_bytes"` ReadCount uint64 `json:"read_count"` WriteCount uint64 `json:"write_count"` // calculated on guest metrics report ReadBps float64 `json:"read_Bps"` WriteBps float64 `json:"write_Bps"` ReadBPS float64 `json:"read_bps"` WriteBPS float64 `json:"write_bps"` ReadIOPS float64 `json:"read_iops"` WriteIOPS float64 `json:"write_iops"` }
func (*DiskIOMetric) ToMap ¶
func (d *DiskIOMetric) ToMap() map[string]interface{}
type GuestMetrics ¶
type GuestMetrics struct { VmCpu *CpuMetric `json:"vm_cpu"` VmMem *MemMetric `json:"vm_mem"` VmNetio []*NetIOMetric `json:"vm_netio"` VmDiskio *DiskIOMetric `json:"vm_diskio"` }
type MemMetric ¶
type NetIOMetric ¶
type NetIOMetric struct { Meta NetMeta `json:"-"` BytesSent uint64 `json:"bytes_sent"` BytesRecv uint64 `json:"bytes_recv"` PacketsSent uint64 `json:"packets_sent"` PacketsRecv uint64 `json:"packets_recv"` ErrIn uint64 `json:"err_in"` ErrOut uint64 `json:"err_out"` DropIn uint64 `json:"drop_in"` DropOut uint64 `json:"drop_out"` // calculated on guest metrics report BPSRecv float64 `json:"bps_recv"` BPSSent float64 `json:"bps_sent"` PPSRecv float64 `json:"pps_recv"` PPSSent float64 `json:"pps_sent"` TimeDiff float64 `json:"-"` }
func (*NetIOMetric) ToMap ¶
func (n *NetIOMetric) ToMap() map[string]interface{}
func (*NetIOMetric) ToTag ¶
func (n *NetIOMetric) ToTag() map[string]string
type SGuestMonitor ¶
type SGuestMonitor struct { Name string Id string Pid int Nics []*desc.SGuestNetwork CpuCnt int Ip string Process *process.Process ScalingGroupId string Tenant string TenantId string DomainId string ProjectDomain string }
func NewGuestMonitor ¶
func NewGuestMonitor(name, id string, pid int, nics []*desc.SGuestNetwork, cpuCount int, ) (*SGuestMonitor, error)
func (*SGuestMonitor) Cpu ¶
func (m *SGuestMonitor) Cpu() *CpuMetric
func (*SGuestMonitor) Diskio ¶
func (m *SGuestMonitor) Diskio() *DiskIOMetric
func (*SGuestMonitor) GetSriovNicStats ¶
func (m *SGuestMonitor) GetSriovNicStats(pfName string, virtfn int) (*psnet.IOCountersStat, error)
func (*SGuestMonitor) Mem ¶
func (m *SGuestMonitor) Mem() *MemMetric
func (*SGuestMonitor) Netio ¶
func (m *SGuestMonitor) Netio() []*NetIOMetric
func (*SGuestMonitor) SetNicDown ¶
func (m *SGuestMonitor) SetNicDown(index int)
func (*SGuestMonitor) UpdateCpuCount ¶
func (m *SGuestMonitor) UpdateCpuCount(vcpuCount int)
func (*SGuestMonitor) UpdateNicsDesc ¶
func (m *SGuestMonitor) UpdateNicsDesc(nics []*desc.SGuestNetwork)
func (*SGuestMonitor) UpdateVmName ¶
func (m *SGuestMonitor) UpdateVmName(name string)
type SGuestMonitorCollector ¶
type SGuestMonitorCollector struct {
// contains filtered or unexported fields
}
func NewGuestMonitorCollector ¶
func NewGuestMonitorCollector() *SGuestMonitorCollector
func (*SGuestMonitorCollector) CollectReportData ¶
func (s *SGuestMonitorCollector) CollectReportData() (ret string)
func (*SGuestMonitorCollector) GetGuests ¶
func (s *SGuestMonitorCollector) GetGuests() map[string]*SGuestMonitor
type SHostMetricsCollector ¶
type SHostMetricsCollector struct { ReportInterval int // seconds LastCollectTime time.Time // contains filtered or unexported fields }
func NewHostMetricsCollector ¶
func NewHostMetricsCollector() *SHostMetricsCollector
func (*SHostMetricsCollector) Start ¶
func (m *SHostMetricsCollector) Start()
func (*SHostMetricsCollector) Stop ¶
func (m *SHostMetricsCollector) Stop()
Click to show internal directories.
Click to hide internal directories.