host

package
v0.0.0-...-b524ce4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name(ctx context.Context, id string, cl collector.Client) string

Name retrieves host name

func NewCollector

func NewCollector(ctx context.Context, cc *collector.CollectorContext, collectNetwork bool, collectDuration prometheus.Observer) prometheus.Collector

NewCollector creates a new collector

Types

type Host

type Host struct {
	ID      string `xml:"id,attr"`
	Name    string `xml:"name"`
	Cluster struct {
		ID string `xml:"id,attr"`
	} `xml:"cluster"`
	Status string `xml:"status"`
	CPU    struct {
		Speed    int `xml:"speed"`
		Topology struct {
			Cores   int `xml:"cores"`
			Sockets int `xml:"sockets"`
			Threads int `xml:"threads"`
		} `xml:"topology"`
	} `xml:"cpu"`
	Memory int64 `xml:"memory"`
}

Host represents the host resource

func Get

func Get(ctx context.Context, id string, cl collector.Client) (*Host, error)

Get retrieves host information

type HostCollector

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

HostCollector collects host statistics from oVirt

func (*HostCollector) Collect

func (c *HostCollector) Collect(ch chan<- prometheus.Metric)

Collect implements Prometheus Collector interface

func (*HostCollector) Describe

func (c *HostCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements Prometheus Collector interface

type Hosts

type Hosts struct {
	Hosts []Host `xml:"host"`
}

Hosts is a collection of Host

Jump to

Keyboard shortcuts

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