agent

package
v0.0.0-...-a0e2ce6 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package agent handles the agent's SSH server and system stats collection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string) (value string, exists bool)

GetEnv retrieves an environment variable with a "BESZEL_AGENT_" prefix, or falls back to the unprefixed key.

func Update

func Update()

Update updates beszel-agent to the latest version

Types

type Agent

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

func NewAgent

func NewAgent() *Agent

func (*Agent) Run

func (a *Agent) Run(pubKey []byte, addr string)

type GPUManager

type GPUManager struct {
	GpuDataMap map[string]*system.GPUData
	// contains filtered or unexported fields
}

GPUManager manages data collection for GPUs (either Nvidia or AMD)

func NewGPUManager

func NewGPUManager() (*GPUManager, error)

NewGPUManager creates and initializes a new GPUManager

func (*GPUManager) GetCurrentData

func (gm *GPUManager) GetCurrentData() map[string]system.GPUData

sums and resets the current GPU utilization data since the last update

type RocmSmiJson

type RocmSmiJson struct {
	ID           string `json:"GUID"`
	Name         string `json:"Card series"`
	Temperature  string `json:"Temperature (Sensor edge) (C)"`
	MemoryUsed   string `json:"VRAM Total Used Memory (B)"`
	MemoryTotal  string `json:"VRAM Total Memory (B)"`
	Usage        string `json:"GPU use (%)"`
	PowerPackage string `json:"Average Graphics Package Power (W)"`
	PowerSocket  string `json:"Current Socket Graphics Package Power (W)"`
}

RocmSmiJson represents the JSON structure of rocm-smi output

Jump to

Keyboard shortcuts

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