hostmetrics

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TelegrafServer     = "http://127.0.0.1:8087/write"
	MeasurementsPrefix = "vm_"
)

Variables

This section is empty.

Functions

func Init

func Init()

func Start

func Start()

func Stop

func Stop()

Types

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 (*SGuestMonitor) Diskio

func (m *SGuestMonitor) Diskio() jsonutils.JSONObject

func (*SGuestMonitor) Mem

func (*SGuestMonitor) Netio

func (m *SGuestMonitor) Netio() jsonutils.JSONObject

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

func (*SGuestMonitorCollector) GetIoFiledName

func (s *SGuestMonitorCollector) GetIoFiledName(field string) string

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()

Jump to

Keyboard shortcuts

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