Documentation ¶
Index ¶
- func IsValidScheduler(blockdev, scheduler string) bool
- func IsValidforNrRequests(blockdev, nrreq string) bool
- func IsValidforReadAheadKB(blockdev, readahead string) bool
- func MaxI(values ...int) int
- func MaxI64(values ...int64) int64
- func MaxU64(values ...uint64) uint64
- func MinU64(values ...uint64) uint64
- type BlockDeviceNrRequests
- type BlockDeviceQueue
- type BlockDeviceReadAheadKB
- type BlockDeviceSchedulers
- type Parameter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidScheduler ¶
IsValidScheduler checks, if the scheduler value is supported by the system. only used during optimize During initialize, the scheduler is read from the system, so no check needed. Only needed during optimize, as apply is using the value from optimize and revert is using the stored valid old values from before apply. And a scheduler can only change during a system reboot (single-queued -> multi-queued)
func IsValidforNrRequests ¶
IsValidforNrRequests checks, if the nr_requests value is supported by the system it's not a good idea to use this during optimize, as it will write a new value to the device, so only used during apply, but this can be performed in a better way.
func IsValidforReadAheadKB ¶
IsValidforReadAheadKB checks, if the read_ahead_kb value is supported by the system it's not a good idea to use this during optimize, as it will write a new value to the device, so only used during apply, but this can be performed in a better way.
func MaxI ¶
MaxI returns the maximum among the input values. If there isn't any input value, return 0.
func MaxI64 ¶
MaxI64 returns the maximum among the input values. If there isn't any input value, return 0.
Types ¶
type BlockDeviceNrRequests ¶
BlockDeviceNrRequests changes IO nr_requests on all block devices
func (BlockDeviceNrRequests) Apply ¶
func (ior BlockDeviceNrRequests) Apply(blkdev interface{}) error
Apply sets the new nr_requests value in the system
func (BlockDeviceNrRequests) Inspect ¶
func (ior BlockDeviceNrRequests) Inspect() (Parameter, error)
Inspect retrieves the current nr_requests from the system
func (BlockDeviceNrRequests) Optimise ¶
func (ior BlockDeviceNrRequests) Optimise(newNrRequestValue interface{}) (Parameter, error)
Optimise gets the expected nr_requests value from the configuration
type BlockDeviceQueue ¶
type BlockDeviceQueue struct { BlockDeviceSchedulers BlockDeviceNrRequests BlockDeviceReadAheadKB }
BlockDeviceQueue is the data structure for block devices for schedulers, IO nr_request and read_ahead_kb changes
type BlockDeviceReadAheadKB ¶
BlockDeviceReadAheadKB changes the read_ahead_kb value on all block devices
func (BlockDeviceReadAheadKB) Apply ¶
func (rakb BlockDeviceReadAheadKB) Apply(blkdev interface{}) error
Apply sets the new read_ahead_kb value in the system
func (BlockDeviceReadAheadKB) Inspect ¶
func (rakb BlockDeviceReadAheadKB) Inspect() (Parameter, error)
Inspect retrieves the current read_ahead_kb from the system
func (BlockDeviceReadAheadKB) Optimise ¶
func (rakb BlockDeviceReadAheadKB) Optimise(newReadAheadKBValue interface{}) (Parameter, error)
Optimise gets the expected read_ahead_kb value from the configuration
type BlockDeviceSchedulers ¶
BlockDeviceSchedulers changes IO elevators on all IO devices
func (BlockDeviceSchedulers) Apply ¶
func (ioe BlockDeviceSchedulers) Apply(blkdev interface{}) error
Apply sets the new scheduler value in the system
func (BlockDeviceSchedulers) Inspect ¶
func (ioe BlockDeviceSchedulers) Inspect() (Parameter, error)
Inspect retrieves the current scheduler from the system
func (BlockDeviceSchedulers) Optimise ¶
func (ioe BlockDeviceSchedulers) Optimise(newElevatorName interface{}) (Parameter, error)
Optimise gets the expected scheduler value from the configuration
type Parameter ¶
type Parameter interface { Inspect() (Parameter, error) // Read the parameter values from current system. Optimise(additionalInput interface{}) (Parameter, error) // Calculate new values based on internal states, and return a copy of new states. Apply(additionalInput interface{}) error // Apply the parameter value without further calculation. }
Parameter is a tunable parameter, usually calculated based on user input and/or automatically. Parameter is immutable. Internal state changes can only be made to copies.