automaxprocsgo.uber.org/automaxprocs/internal/runtime Index | Files

package runtime

import "go.uber.org/automaxprocs/internal/runtime"

Index

Functions

func DefaultRoundFunc

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(_ int, _ func(v float64) int) (int, CPUQuotaStatus, error)

CPUQuotaToGOMAXPROCS converts the CPU quota applied to the calling process to a valid GOMAXPROCS value. This is Linux-specific and not supported in the current OS.

Source Files

cpu_quota_unsupported.go runtime.go

Version
v1.6.0 (latest)
Published
Sep 23, 2024
Platform
js/wasm
Imports
1 packages
Last checked
6 hours ago

Tools for package owners.