Documentation ¶
Overview ¶
Package sys provides system configuration and tuning.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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) )
var AffineCPU = cfg.NewProviderFunc("affinecpu", "CPU information for processors assigned to this process", affinecpu)
Functions ¶
func AffineCPUFreq ¶
AffineCPUFreq builds a configuration provider for CPU frequency scaling information for processors the process is assigned to.
func AffineCaches ¶
AffineCaches returns a config provider for caches on CPUs assigned to this process.
Types ¶
type DeactivateSMT ¶
type DeactivateSMT struct{}
DeactivateSMT disables simultaneous multithreading.
func (DeactivateSMT) Available ¶
func (DeactivateSMT) Available() bool
Available reports whether the process can control 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) 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.
type SMT ¶
type SMT struct{}
SMT provides simultaneous multithreading configuration.
func (SMT) Configuration ¶
func (SMT) Configuration() (cfg.Configuration, error)
Configuration queries sysfs for simultaneous multithreading configuration.
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) 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) Configuration ¶
func (Thermal) Configuration() (cfg.Configuration, error)
Configuration queries sysfs for thermal zone status.