metrics

package
v1.38.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidEBSMagic = errors.New("invalid EBS magic number")
	ErrParseLogPage    = errors.New("failed to parse log page")
)

Functions

func InitializeNVME added in v1.37.0

func InitializeNVME(r *metricRecorder, csiMountPointPath, instanceID string)

InitializeNVME registers the NVMe collector for gathering metrics from NVMe devices.

func InitializeRecorder

func InitializeRecorder() *metricRecorder

InitializeRecorder initializes a new metricRecorder instance if it hasn't been initialized.

func Recorder

func Recorder() *metricRecorder

Recorder returns the singleton instance of metricRecorder. nil is returned if the recorder is not initialized.

Types

type BlockDevice added in v1.37.0

type BlockDevice struct {
	Name   string `json:"name"`
	Serial string `json:"serial"`
}

type EBSMetrics added in v1.37.0

type EBSMetrics struct {
	EBSMagic              uint64
	ReadOps               uint64
	WriteOps              uint64
	ReadBytes             uint64
	WriteBytes            uint64
	TotalReadTime         uint64
	TotalWriteTime        uint64
	EBSIOPSExceeded       uint64
	EBSThroughputExceeded uint64
	EC2IOPSExceeded       uint64
	EC2ThroughputExceeded uint64
	QueueLength           uint64
	ReservedArea          [416]byte
	ReadLatency           Histogram
	WriteLatency          Histogram
}

EBSMetrics represents the parsed metrics from the NVMe log page.

type Histogram added in v1.37.0

type Histogram struct {
	BinCount uint64
	Bins     [64]HistogramBin
}

type HistogramBin added in v1.37.0

type HistogramBin struct {
	Lower uint64
	Upper uint64
	Count uint64
}

type LsblkOutput added in v1.37.0

type LsblkOutput struct {
	BlockDevices []BlockDevice `json:"blockdevices"`
}

type NVMECollector added in v1.37.0

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

func NewNVMECollector added in v1.37.0

func NewNVMECollector(path, instanceID string) *NVMECollector

NewNVMECollector creates a new instance of NVMECollector.

func (*NVMECollector) Collect added in v1.37.0

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

Collect is invoked by Prometheus at collection time.

func (*NVMECollector) Describe added in v1.37.0

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

Describe sends the descriptor of each metric in the NVMECollector to Prometheus.

Jump to

Keyboard shortcuts

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