sys

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 12 Imported by: 2

Documentation

Overview

Package sys provides methods to read system information

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Package sys provides methods to read system information

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Package sys provides methods to read system information

  • Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.

Package sys provides methods to read system information

  • Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.

Package sys provides methods to read system information

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Package sys provides methods to read system information

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Package sys provides methods to read system information

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Index

Constants

View Source
const (
	ExtremeLoad = 92
	HighLoad    = 82
)

used with MaxLoad() floating point; HighLoad < HighLoadWM() < ExtremeLoad

Variables

This section is empty.

Functions

func Containerized

func Containerized() bool

func GoEnvMaxprocs added in v1.3.24

func GoEnvMaxprocs()

func HighLoadWM added in v1.3.26

func HighLoadWM() int

"high-load watermark", to maybe throttle when MaxLoad() is above see also (ExtremeLoad, HighLoad) defaults

func MaxLoad added in v1.3.26

func MaxLoad() (load float64)

return max(1 minute, 5 minute) load average

func MaxLoad2 added in v1.3.30

func MaxLoad2() (load float64, isExtreme bool)

func MaxParallelism added in v1.3.26

func MaxParallelism() int

number of intra-cluster broadcasting goroutines

func NumCPU

func NumCPU() int

func ProcFDSize added in v1.3.31

func ProcFDSize() int

Types

type LoadAvg

type LoadAvg struct {
	One, Five, Fifteen float64
}

func LoadAverage

func LoadAverage() (avg LoadAvg, _ error)

type MemStat

type MemStat struct {
	Total      uint64
	Used       uint64
	Free       uint64
	BuffCache  uint64
	ActualFree uint64
	ActualUsed uint64
	SwapTotal  uint64
	SwapFree   uint64
	SwapUsed   uint64
}

func (*MemStat) Get

func (mem *MemStat) Get() error

func (*MemStat) Str added in v1.3.26

func (mem *MemStat) Str(sb *strings.Builder)

type ProcCPUStats

type ProcCPUStats struct {
	User     uint64
	System   uint64
	Total    uint64
	LastTime int64
	Percent  float64
}

type ProcMemStats

type ProcMemStats struct {
	Size     uint64
	Resident uint64
	Share    uint64
}

type ProcStats

type ProcStats struct {
	CPU ProcCPUStats
	Mem ProcMemStats
}

func ProcessStats

func ProcessStats(pid int) (ProcStats, error)

Jump to

Keyboard shortcuts

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