nvidia

package
v0.0.0-...-f8e543c Latest Latest
Warning

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

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

Documentation

Overview

Package nvidia holds the logic to collect metrics from the NVIDIA Management Library (NVML). The main entry point is the BuildCollectors functions, which returns a set of collectors that will gather metrics from the available NVIDIA devices on the system. Each collector is responsible for a specific subsystem of metrics, such as device metrics, GPM metrics, etc. The collected metrics will be returned with the associated tags for each device.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	// Collect collects metrics from the given NVML device. This method should not fill the tags
	// unless they're metric-specific (i.e., all device-specific tags will be added by the Collector itself)
	Collect() ([]Metric, error)

	// Close closes the subsystem and releases any resources it might have allocated
	Close() error

	// name returns the name of the subsystem
	Name() string
}

Collector defines a collector that gets metric from a specific NVML subsystem and device

func BuildCollectors

func BuildCollectors(lib nvml.Interface) ([]Collector, error)

BuildCollectors returns a set of collectors that can be used to collect metrics from NVML.

type Metric

type Metric struct {
	Name  string   // Name holds the name of the metric.
	Value float64  // Value holds the value of the metric.
	Tags  []string // Tags holds the tags associated with the metric.
}

Metric represents a single metric collected from the NVML library.

Jump to

Keyboard shortcuts

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