metrics

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorTypePCINotFound      = "pci_not_found"
	ErrorTypeDriverNotFound   = "driver_not_found"
	ErrorTypePermissionDenied = "permission_denied"
	ErrorTypeDeviceInUse      = "device_in_use"
	ErrorTypeConfigFileError  = "config_file_error"
	ErrorTypeValidationError  = "validation_error"
	ErrorTypeConcurrencyError = "concurrency_error"
	ErrorTypeTimeoutError     = "timeout_error"
	ErrorTypeUnknownError     = "unknown_error"
)

ErrorType constants for consistent error categorization

View Source
const (
	OperationTypeBind           = "bind"
	OperationTypeUnbind         = "unbind"
	OperationTypeConfigUpdate   = "config_update"
	OperationTypeConfigValidate = "config_validate"
	OperationTypeConfigBackup   = "config_backup"
	OperationTypeConfigRestore  = "config_restore"
)

OperationType constants for consistent operation categorization

Variables

View Source
var GlobalMetricsCollector = NewCollector()

GlobalMetricsCollector is the global metrics collector instance

Functions

func RecordDPDKBindFailure

func RecordDPDKBindFailure(driver string, duration time.Duration, errorType string)

RecordDPDKBindFailure records a failed DPDK bind operation

func RecordDPDKBindSuccess

func RecordDPDKBindSuccess(driver string, duration time.Duration)

RecordDPDKBindSuccess records a successful DPDK bind operation

func RecordSRIOVConfigFailure

func RecordSRIOVConfigFailure(operationType string, duration time.Duration, errorType string)

RecordSRIOVConfigFailure records a failed SR-IOV configuration operation

func RecordSRIOVConfigSuccess

func RecordSRIOVConfigSuccess(operationType string, duration time.Duration)

RecordSRIOVConfigSuccess records a successful SR-IOV configuration operation

Types

type Collector

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

Collector provides methods for collecting SR-IOV and DPDK metrics

func NewCollector

func NewCollector() *Collector

NewCollector creates a new metrics collector

func (*Collector) NewDPDKOperationTimer

func (m *Collector) NewDPDKOperationTimer(driver, operationType string) *DPDKOperationTimer

NewDPDKOperationTimer creates a new DPDK operation timer

func (*Collector) NewSRIOVOperationTimer

func (m *Collector) NewSRIOVOperationTimer(operationType string) *SRIOVOperationTimer

NewSRIOVOperationTimer creates a new SR-IOV operation timer

func (*Collector) RecordDPDKBindOperation

func (m *Collector) RecordDPDKBindOperation(driver, operationType string, duration time.Duration, success bool)

RecordDPDKBindOperation records a DPDK bind operation

func (*Collector) RecordDPDKOperationError

func (m *Collector) RecordDPDKOperationError(errorType, operation string)

RecordDPDKOperationError records a DPDK operation error

func (*Collector) RecordSRIOVConfigError

func (m *Collector) RecordSRIOVConfigError(errorType, operation string)

RecordSRIOVConfigError records an SR-IOV configuration error

func (*Collector) RecordSRIOVConfigOperation

func (m *Collector) RecordSRIOVConfigOperation(operationType string, duration time.Duration, success bool)

RecordSRIOVConfigOperation records an SR-IOV configuration operation

func (*Collector) UpdateConcurrentDPDKOperations

func (m *Collector) UpdateConcurrentDPDKOperations(count float64)

UpdateConcurrentDPDKOperations updates the count of concurrent DPDK operations

func (*Collector) UpdateDPDKBoundInterfacesCount

func (m *Collector) UpdateDPDKBoundInterfacesCount(driver, node string, count float64)

UpdateDPDKBoundInterfacesCount updates the count of DPDK bound interfaces

func (*Collector) UpdateDPDKOperationsMapSize

func (m *Collector) UpdateDPDKOperationsMapSize(size float64)

UpdateDPDKOperationsMapSize updates the size of the DPDK operations map

func (*Collector) UpdateSRIOVResourcesCount

func (m *Collector) UpdateSRIOVResourcesCount(resourceName, node string, count float64)

UpdateSRIOVResourcesCount updates the count of SR-IOV resources

type DPDKOperationTimer

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

DPDKOperationTimer provides timing functionality for DPDK operations

func (*DPDKOperationTimer) Finish

func (t *DPDKOperationTimer) Finish(success bool)

Finish records the completion of a DPDK operation

type SRIOVOperationTimer

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

SRIOVOperationTimer provides timing functionality for SR-IOV operations

func (*SRIOVOperationTimer) Finish

func (t *SRIOVOperationTimer) Finish(success bool)

Finish records the completion of an SR-IOV operation

Jump to

Keyboard shortcuts

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