param

package
v0.0.0-...-883cb22 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidScheduler

func IsValidScheduler(blockdev, scheduler string) bool

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

func IsValidforNrRequests(blockdev, nrreq string) bool

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

func IsValidforReadAheadKB(blockdev, readahead string) bool

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

func MaxI(values ...int) int

MaxI returns the maximum among the input values. If there isn't any input value, return 0.

func MaxI64

func MaxI64(values ...int64) int64

MaxI64 returns the maximum among the input values. If there isn't any input value, return 0.

func MaxU64

func MaxU64(values ...uint64) uint64

MaxU64 returns the maximum among the input values. If there isn't any input value, return 0.

func MinU64

func MinU64(values ...uint64) uint64

MinU64 returns the minimum among the input values. If there isn't any input value, return 0.

Types

type BlockDeviceNrRequests

type BlockDeviceNrRequests struct {
	NrRequests map[string]int
}

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

BlockDeviceQueue is the data structure for block devices for schedulers, IO nr_request and read_ahead_kb changes

type BlockDeviceReadAheadKB

type BlockDeviceReadAheadKB struct {
	ReadAheadKB map[string]int
}

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

type BlockDeviceSchedulers struct {
	SchedulerChoice map[string]string
}

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.

Jump to

Keyboard shortcuts

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