Documentation ¶
Index ¶
- func IsValidScheduler(blockdev, scheduler string) bool
- func IsValidforNrRequests(blockdev, nrreq string) bool
- func IsValidforReadAheadKB(blockdev, readahead string) bool
- type BlockDeviceMaxSectorsKB
- 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.
Types ¶
type BlockDeviceMaxSectorsKB ¶
BlockDeviceMaxSectorsKB changes the max_sectors_kb value on all block devices
func (BlockDeviceMaxSectorsKB) Apply ¶
func (mskb BlockDeviceMaxSectorsKB) Apply(blkdev interface{}) error
Apply sets the new max_sectors_kb value in the system
func (BlockDeviceMaxSectorsKB) Inspect ¶
func (mskb BlockDeviceMaxSectorsKB) Inspect() (Parameter, error)
Inspect retrieves the current max_sectors_kb from the system
func (BlockDeviceMaxSectorsKB) Optimise ¶
func (mskb BlockDeviceMaxSectorsKB) Optimise(newMaxSectorsKBValue interface{}) (Parameter, error)
Optimise gets the expected max_sectors_kb value from the configuration
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 BlockDeviceMaxSectorsKB }
BlockDeviceQueue is the data structure for block devices for schedulers, IO nr_request, read_ahead_kb and max_sectors_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.