runtime

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRoundFunc added in v1.6.0

func DefaultRoundFunc(v float64) int

DefaultRoundFunc is the default function to convert CPU quota from float to int. It rounds the value down (floor).

Types

type CPUQuotaStatus

type CPUQuotaStatus int

CPUQuotaStatus presents the status of how CPU quota is used

const (
	// CPUQuotaUndefined is returned when CPU quota is undefined
	CPUQuotaUndefined CPUQuotaStatus = iota
	// CPUQuotaUsed is returned when a valid CPU quota can be used
	CPUQuotaUsed
	// CPUQuotaMinUsed is returned when CPU quota is smaller than the min value
	CPUQuotaMinUsed
)

func CPUQuotaToGOMAXPROCS

func CPUQuotaToGOMAXPROCS(minValue int, round func(v float64) int) (int, CPUQuotaStatus, error)

CPUQuotaToGOMAXPROCS converts the CPU quota applied to the calling process to a valid GOMAXPROCS value. The quota is converted from float to int using round. If round == nil, DefaultRoundFunc is used.

Jump to

Keyboard shortcuts

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