sys

package
v0.0.0-...-c9cfaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package sys provides system configuration and tuning.

Index

Constants

This section is empty.

Variables

View Source
var (
	Host          = cfg.NewProviderFunc("host", "Host statistics.", host)
	VirtualMemory = cfg.NewProviderFunc("mem", "Virtual memory usage statistics.", virtualmemory)
	CPU           = cfg.NewProviderFunc("cpu", "CPU information", cpu)
	LoadAverage   = cfg.NewProviderFunc("load", "Load averages", load)
)
View Source
var AffineCPU = cfg.NewProviderFunc("affinecpu", "CPU information for processors assigned to this process", affinecpu)

Functions

func AffineCPUFreq

func AffineCPUFreq() cfg.Provider

AffineCPUFreq builds a configuration provider for CPU frequency scaling information for processors the process is assigned to.

func AffineCaches

func AffineCaches() cfg.Provider

AffineCaches returns a config provider for caches on CPUs assigned to this process.

func CPUFreq

func CPUFreq() cfg.Provider

CPUFreq builds a configuration provider for CPU frequency scaling information.

func Caches

func Caches() cfg.Provider

Caches returns a config provider for all CPU caches.

Types

type DeactivateSMT

type DeactivateSMT struct{}

DeactivateSMT disables simultaneous multithreading.

func (DeactivateSMT) Apply

func (DeactivateSMT) Apply() error

Apply turns off SMT.

func (DeactivateSMT) Available

func (DeactivateSMT) Available() bool

Available reports whether the process can control SMT.

func (DeactivateSMT) Name

func (DeactivateSMT) Name() string

Name of the tuning method.

func (DeactivateSMT) Reset

func (DeactivateSMT) Reset() error

Reset turns on SMT.

type DisableIntelTurbo

type DisableIntelTurbo struct{}

DisableIntelTurbo is a tuner that sets the "no_turbo" flag in the Intel P-State driver.

func (DisableIntelTurbo) Apply

func (DisableIntelTurbo) Apply() error

Apply enables the "no_turbo" flag.

func (DisableIntelTurbo) Available

func (DisableIntelTurbo) Available() bool

Available reports whether the process can write to the no_turbo file.

func (DisableIntelTurbo) Name

func (DisableIntelTurbo) Name() string

Name of the tuning method.

func (DisableIntelTurbo) Reset

func (DisableIntelTurbo) Reset() error

Reset disables the "no_turbo" flag.

type IntelPState

type IntelPState struct{}

IntelPState provides configuration about the Intel P-State driver.

func (IntelPState) Available

func (IntelPState) Available() bool

Available checks whether the Intel P-State sysfs files are present.

func (IntelPState) Configuration

func (IntelPState) Configuration() (cfg.Configuration, error)

Configuration queries sysfs for Intel P-state configuration.

func (IntelPState) Doc

func (IntelPState) Doc() string

Doc for the configuration provider.

func (IntelPState) Key

func (IntelPState) Key() cfg.Key

Key returns "intelpstate".

type SMT

type SMT struct{}

SMT provides simultaneous multithreading configuration.

func (SMT) Available

func (SMT) Available() bool

Available checks whether the smt sysfs files are present.

func (SMT) Configuration

func (SMT) Configuration() (cfg.Configuration, error)

Configuration queries sysfs for simultaneous multithreading configuration.

func (SMT) Doc

func (SMT) Doc() string

Doc for the configuration provider.

func (SMT) Key

func (SMT) Key() cfg.Key

Key returns "smt".

type SetFrequency

type SetFrequency struct {
	Percent float64
	// contains filtered or unexported fields
}

SetFrequency is a tuner that sets the frequency of all CPUs to a given percentage of the allowed range.

This technique is the same as perflock: https://github.com/aclements/perflock.

func (*SetFrequency) Apply

func (s *SetFrequency) Apply() error

Apply sets frequency on all online CPUs to the configured percentage within their range.

func (*SetFrequency) Available

func (s *SetFrequency) Available() bool

Available reports whether the process can write to the frequency files.

func (*SetFrequency) Name

func (s *SetFrequency) Name() string

Name of the tuning method.

func (*SetFrequency) Reset

func (s *SetFrequency) Reset() error

Reset frequencies to values prior to the Apply() call.

type SetScalingGovernor

type SetScalingGovernor struct {
	Governor string
}

SetScalingGovernor is a tuner that sets the scaling governor on all CPUs to a given value.

func (SetScalingGovernor) Apply

func (s SetScalingGovernor) Apply() error

Apply sets scaling governors on all online CPUs to the configured value.

func (SetScalingGovernor) Available

func (s SetScalingGovernor) Available() bool

Available reports whether the process can write to the scaling governor files.

func (SetScalingGovernor) Name

func (s SetScalingGovernor) Name() string

Name of the tuning method.

func (SetScalingGovernor) Reset

func (s SetScalingGovernor) Reset() error

Reset sets scaling governors on all online CPUs to "powersave".

type Thermal

type Thermal struct{}

Thermal provides system thermal state.

func (Thermal) Available

func (Thermal) Available() bool

Available checks whether the thermal sysfs files are present.

func (Thermal) Configuration

func (Thermal) Configuration() (cfg.Configuration, error)

Configuration queries sysfs for thermal zone status.

func (Thermal) Doc

func (Thermal) Doc() string

Doc for the configuration provider.

func (Thermal) Key

func (Thermal) Key() cfg.Key

Key returns "thermal".

Jump to

Keyboard shortcuts

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