metric_reader

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(metricsURL string) *readerImpl

Types

type NodeMetrics

type NodeMetrics struct {
	// cpu
	CpuCoreCount    int     `json:"cpu_core_count"`
	CpuLoadInfo     string  `json:"cpu_load_info"`
	CpuUsagePercent float64 `json:"cpu_usage_percent"`

	// memory
	MemoryTotalBytes   float64 `json:"memory_total_bytes"`
	MemoryUsageBytes   float64 `json:"memory_usage_bytes"`
	MemoryUsagePercent float64 `json:"memory_usage_percent"`

	// disk
	DiskTotalBytes   float64 `json:"disk_total_bytes"`
	DiskUsageBytes   float64 `json:"disk_usage_bytes"`
	DiskUsagePercent float64 `json:"disk_usage_percent"`

	// network
	NetworkReceiveBytesTotal  float64 `json:"network_receive_bytes_total"`
	NetworkTransmitBytesTotal float64 `json:"network_transmit_bytes_total"`
	NetworkReceiveBytesRate   float64 `json:"network_receive_bytes_rate"`
	NetworkTransmitBytesRate  float64 `json:"network_transmit_bytes_rate"`

	// ping
	PingMetrics []PingMetric `json:"ping_metrics"`
	// contains filtered or unexported fields
}

type PingMetric

type PingMetric struct {
	Latency float64 `json:"latency"` // in ms
	Target  string  `json:"target"`
}

type Reader

type Reader interface {
	ReadOnce(ctx context.Context) (*NodeMetrics, error)
}

Jump to

Keyboard shortcuts

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