hwstats

package
v0.0.0-...-2d99d9e Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CPURequestEnvVar = "LIVEKIT_CPU_REQUEST"

Variables

This section is empty.

Functions

func EffectiveCPURequest

func EffectiveCPURequest() float64

EffectiveCPURequest returns the value of LIVEKIT_CPU_REQUEST when set and valid. The result is parsed at most once; use for stats normalization and optional GOMAXPROCS tuning (see utils/hwstats/maxprocs).

Types

type CPUStats

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

func NewCPUStats

func NewCPUStats(idleUpdateCallback func(idle float64)) (*CPUStats, error)

func NewProcMonitor

func NewProcMonitor(onUpdate func(*ProcStats)) (*CPUStats, error)

func (*CPUStats) GetCPUIdle

func (c *CPUStats) GetCPUIdle() float64

func (*CPUStats) GetCPULoad

func (c *CPUStats) GetCPULoad() float64

func (*CPUStats) NumCPU

func (c *CPUStats) NumCPU() float64

func (*CPUStats) Stop

func (c *CPUStats) Stop()

type GroupMemory

type GroupMemory struct {
	Total int
	Procs map[int]ProcMemoryEntry
}

type MemoryStats

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

func NewMemoryStats

func NewMemoryStats() (*MemoryStats, error)

func (*MemoryStats) GetMemory

func (m *MemoryStats) GetMemory() (uint64, uint64, error)

type ProcMemoryEntry

type ProcMemoryEntry struct {
	Name   string
	Memory int
}

type ProcStats

type ProcStats struct {
	CpuIdle     float64
	Cpu         map[int]float64
	MemoryTotal int
	Memory      map[int]*GroupMemory
}

Directories

Path Synopsis
Package maxprocs caps GOMAXPROCS to the Kubernetes CPU request so the Go scheduler doesn't create more OS threads than the pod is guaranteed.
Package maxprocs caps GOMAXPROCS to the Kubernetes CPU request so the Go scheduler doesn't create more OS threads than the pod is guaranteed.

Jump to

Keyboard shortcuts

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