param

package
v0.0.0-...-12ea192 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: GPL-3.0 Imports: 5 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.

Types

type BlockDeviceMaxSectorsKB

type BlockDeviceMaxSectorsKB struct {
	MaxSectorsKB map[string]int
}

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

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, read_ahead_kb and max_sectors_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