hardware

package
v0.0.2-0...-cd56d64 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 24 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCPUNum

func GetCPUNum() int

GetCPUNum returns the count of cpu core.

func GetCPUUsage

func GetCPUUsage() float64

GetCPUUsage returns the cpu usage in percentage.

func GetDiskUsage

func GetDiskUsage(path string) (float64, float64, error)

GetDiskUsage Get Disk Usage in GB

func GetFreeMemoryCount

func GetFreeMemoryCount() uint64

GetFreeMemoryCount returns the free memory in bytes.

func GetIOWait

func GetIOWait() (float64, error)

GetIOWait Get IO Wait Percentage

func GetMemoryCount

func GetMemoryCount() uint64

GetMemoryCount returns the memory count in bytes.

func GetMemoryUseRatio

func GetMemoryUseRatio() float64

func GetUsedMemoryCount

func GetUsedMemoryCount() uint64

GetUsedMemoryCount returns the memory usage in bytes.

func InitMaxprocs

func InitMaxprocs(serverType string, flags *flag.FlagSet)

Initialize maxprocs

func TestGetCgroupStats

func TestGetCgroupStats(t *testing.T)

func TestGetContainerMemLimit

func TestGetContainerMemLimit(t *testing.T)

func TestGetContainerMemUsed

func TestGetContainerMemUsed(t *testing.T)

Types

type GPUMemoryInfo

type GPUMemoryInfo struct {
	TotalMemory uint64 // Total memory available on the GPU
	FreeMemory  uint64 // Free memory available on the GPU
}

GPUMemoryInfo holds information about a GPU's memory

func GetAllGPUMemoryInfo

func GetAllGPUMemoryInfo() ([]GPUMemoryInfo, error)

GetAllGPUMemoryInfo returns mock GPU memory information for non-CUDA builds

Jump to

Keyboard shortcuts

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