Documentation ¶
Index ¶
- Constants
- func AddParameterNoteValues(param, value, noteID string)
- func CalculateOptimumValue(operator txtparser.Operator, currentValue string, expectedValue string) (string, error)
- func CleanUpParamFile(param string)
- func CleanUpRun()
- func CompareJSValue(v1, v2 interface{}, op string) (v1JS, v2JS string, match bool)
- func CompareNoteFields(actualNote, expectedNote Note) (allMatch bool, comparisons map[string]FieldComparison, valApplyList []string)
- func CreateParameterStartValues(param, value string)
- func GetAllSavedParameters() map[string]ParameterNotes
- func GetBlkVal(key string, cur *param.BlockDeviceQueue) (string, string, error)
- func GetCPUVal(key string) (string, string, string)
- func GetGrubVal(key string) string
- func GetLimitsVal(value string) (string, error)
- func GetLoginVal(key string) (string, error)
- func GetMemVal(key string) string
- func GetPagecacheVal(key string, cur *LinuxPagingImprovements) string
- func GetPathToParameter(param string) string
- func GetRpmVal(key string) string
- func GetServiceVal(key string) string
- func GetVMVal(key string) string
- func IDInParameterList(noteID string, list []ParameterNoteEntry) bool
- func IsLastNoteOfParameter(param string) bool
- func ListParams() (ret []string, err error)
- func OptBlkVal(key, cfgval string, cur *param.BlockDeviceQueue, bOK map[string][]string) (string, string)
- func OptCPUVal(key, actval, cfgval string) string
- func OptGrubVal(key, cfgval string) string
- func OptLimitsVal(actval, cfgval string) string
- func OptLoginVal(cfgval string) string
- func OptMemVal(key, actval, cfgval, tmpfspercent string) string
- func OptPagecacheVal(key, cfgval string, cur *LinuxPagingImprovements) string
- func OptRpmVal(key, cfgval string) string
- func OptServiceVal(key, cfgval string) string
- func OptSysctlVal(operator txtparser.Operator, key, actval, cfgval string) string
- func OptVMVal(key, cfgval string) string
- func PositionInParameterList(noteID string, list []ParameterNoteEntry) int
- func RevertParameter(param, noteID string) (string, string)
- func SetBlkVal(key, value string, cur *param.BlockDeviceQueue, revert bool) error
- func SetCPUVal(key, value, noteID, savedStates, oval, info string, revert bool) error
- func SetGrubVal(value string) error
- func SetLimitsVal(key, noteID, value string, revert bool) error
- func SetLoginVal(key, value string, revert bool) error
- func SetMemVal(key, value string) error
- func SetPagecacheVal(key string, cur *LinuxPagingImprovements) error
- func SetRpmVal(value string) error
- func SetServiceVal(key, value string) error
- func SetVMVal(key, value string) error
- func StoreParameter(param string, obj ParameterNotes, overwriteExisting bool) error
- type FieldComparison
- type INISettings
- type LinuxPagingImprovements
- type Note
- type ParameterNoteEntry
- type ParameterNotes
- type TuningOptions
Constants ¶
const ( INISectionSysctl = "sysctl" INISectionVM = "vm" INISectionCPU = "cpu" INISectionMEM = "mem" INISectionBlock = "block" INISectionService = "service" INISectionLimits = "limits" INISectionLogin = "login" INISectionVersion = "version" INISectionPagecache = "pagecache" INISectionRpm = "rpm" INISectionGrub = "grub" INISectionReminder = "reminder" SysKernelTHPEnabled = "kernel/mm/transparent_hugepage/enabled" SysKSMRun = "kernel/mm/ksm/run" // LoginConfDir is the path to systemd's logind configuration directory under /etc. LogindConfDir = "/etc/systemd/logind.conf.d" // LogindSAPConfFile is a configuration file full of SAP-specific settings for logind. LogindSAPConfFile = "saptune-UserTasksMax.conf" )
section name definition
const OverrideTuningSheets = "/etc/saptune/override/"
OverrideTuningSheets defines saptunes override directory
const SaptuneParameterStateDir = "/var/lib/saptune/parameter"
SaptuneParameterStateDir defines the directory where to store the parameter state files separated from the note state file directory
const SaptuneSectionDir = "/var/lib/saptune/sections"
SaptuneSectionDir defines saptunes saved state directory
Variables ¶
This section is empty.
Functions ¶
func AddParameterNoteValues ¶
func AddParameterNoteValues(param, value, noteID string)
AddParameterNoteValues adds note parameter values to the state file.
func CalculateOptimumValue ¶
func CalculateOptimumValue(operator txtparser.Operator, currentValue string, expectedValue string) (string, error)
CalculateOptimumValue calculates optimum parameter value given the current value, comparison operator, and expected value. Return optimised value.
func CleanUpParamFile ¶
func CleanUpParamFile(param string)
CleanUpParamFile removes the parameter state file
func CompareJSValue ¶
CompareJSValue compares JSON representation of two values and see if they match.
func CompareNoteFields ¶
func CompareNoteFields(actualNote, expectedNote Note) (allMatch bool, comparisons map[string]FieldComparison, valApplyList []string)
CompareNoteFields compares the content of two notes and return differences in their fields in a human-readable text.
func CreateParameterStartValues ¶
func CreateParameterStartValues(param, value string)
CreateParameterStartValues creates the parameter state file and inserts the start values.
func GetAllSavedParameters ¶
func GetAllSavedParameters() map[string]ParameterNotes
GetAllSavedParameters reads all saved parameters from the state directory fill structure app.AllParameters
func GetCPUVal ¶
GetCPUVal initialise the cpu performance structure with the current system settings
func GetGrubVal ¶
GetGrubVal initialise the grub structure with the current system settings
func GetLimitsVal ¶
GetLimitsVal initialise the security limit structure with the current system settings
func GetLoginVal ¶
GetLoginVal initialise the systemd login structure with the current system settings
func GetPagecacheVal ¶
func GetPagecacheVal(key string, cur *LinuxPagingImprovements) string
GetPagecacheVal initialise the pagecache structure with the current system settings
func GetPathToParameter ¶
GetPathToParameter returns path to the serialised parameter state file.
func GetServiceVal ¶
GetServiceVal initialise the systemd service structure with the current system settings
func GetVMVal ¶
GetVMVal initialise the memory management structure with the current system settings
func IDInParameterList ¶
func IDInParameterList(noteID string, list []ParameterNoteEntry) bool
IDInParameterList checks, if given noteID is already part of the parameter list of notes
func IsLastNoteOfParameter ¶
IsLastNoteOfParameter returns true, if there is no parameter state file or false, which means that another note changing the parameter is still applied
func ListParams ¶
ListParams lists all stored parameter states. Return parameter names
func OptBlkVal ¶
func OptBlkVal(key, cfgval string, cur *param.BlockDeviceQueue, bOK map[string][]string) (string, string)
OptBlkVal optimises the block device structure with the settings from the configuration file
func OptCPUVal ¶
OptCPUVal optimises the cpu performance structure with the settings from the configuration file
func OptGrubVal ¶
OptGrubVal returns the value from the configuration file
func OptLimitsVal ¶
OptLimitsVal optimises the security limit structure with the settings from the configuration file or with a calculation
func OptLoginVal ¶
OptLoginVal returns the value from the configuration file
func OptMemVal ¶
OptMemVal optimises the shared memory structure with the settings from the configuration file or with a calculation
func OptPagecacheVal ¶
func OptPagecacheVal(key, cfgval string, cur *LinuxPagingImprovements) string
OptPagecacheVal optimises the pagecache structure with the settings from the configuration file or with a calculation func OptPagecacheVal(key, cfgval string, cur *LinuxPagingImprovements, keyvalue map[string]map[string]txtparser.INIEntry) string {
func OptServiceVal ¶
OptServiceVal optimises the systemd service structure with the settings from the configuration file
func OptSysctlVal ¶
OptSysctlVal optimises a sysctl parameter value use exactly the value from the config file. No calculation any more
func OptVMVal ¶
OptVMVal optimises the memory management structure with the settings from the configuration file
func PositionInParameterList ¶
func PositionInParameterList(noteID string, list []ParameterNoteEntry) int
PositionInParameterList gets the position in the slice AllNotes for a given noteID return the position of the note within the slice. do not sort the slice
func RevertParameter ¶
RevertParameter reverts parameter values and removes noteID reference from the parameter file return value of parameter and related noteID
func SetBlkVal ¶
func SetBlkVal(key, value string, cur *param.BlockDeviceQueue, revert bool) error
SetBlkVal applies the settings to the system
func SetGrubVal ¶
SetGrubVal nothing to do, only checking for 'verify'
func SetLimitsVal ¶
SetLimitsVal applies the settings to the system
func SetLoginVal ¶
SetLoginVal applies the settings to the system
func SetPagecacheVal ¶
func SetPagecacheVal(key string, cur *LinuxPagingImprovements) error
SetPagecacheVal applies the settings to the system
func SetServiceVal ¶
SetServiceVal applies the settings to the system
func StoreParameter ¶
func StoreParameter(param string, obj ParameterNotes, overwriteExisting bool) error
StoreParameter stores parameter values to state directory Write a json file with the name of the given parameter containing the applied noteIDs for this parameter and the associated parameter values
Types ¶
type FieldComparison ¶
type FieldComparison struct { ReflectFieldName string // Structure field name ReflectMapKey string // If structure field is a map, this is the map key ActualValue, ExpectedValue interface{} ActualValueJS, ExpectedValueJS string MatchExpectation bool }
FieldComparison records the actual value versus expected value for a note field. The field name has to be the actual name in Go struct.
type INISettings ¶
type INISettings struct { ConfFilePath string // Full path to the 3rd party vendor's tuning configuration file ID string // ID portion of the tuning configuration DescriptiveName string // Descriptive name portion of the tuning configuration SysctlParams map[string]string // Sysctl parameter values from the computer system ValuesToApply map[string]string // values to apply OverrideParams map[string]string // parameter values from the override file Inform map[string]string // special information for parameter values }
INISettings defines tuning options composed by a third party vendor.
func (INISettings) Apply ¶
func (vend INISettings) Apply() error
Apply sets the new parameter values in the system or revert the system to the former parameter values
func (INISettings) Initialise ¶
func (vend INISettings) Initialise() (Note, error)
Initialise retrieves the current parameter values from the system
func (INISettings) Name ¶
func (vend INISettings) Name() string
Name returns the name of the related SAP Note or en empty string
func (INISettings) Optimise ¶
func (vend INISettings) Optimise() (Note, error)
Optimise gets the expected parameter values from the configuration
func (INISettings) SetValuesToApply ¶
func (vend INISettings) SetValuesToApply(values []string) Note
SetValuesToApply fills the data structure for applying the changes
type LinuxPagingImprovements ¶
type LinuxPagingImprovements struct { PagingConfig string // configuration file for page cache, used by test cases and during optimise VMPagecacheLimitMB uint64 VMPagecacheLimitIgnoreDirty int UseAlgorithmForHANA bool }
LinuxPagingImprovements defines SAP Note 1557506 1557506 - Linux paging improvements
func (LinuxPagingImprovements) Apply ¶
func (paging LinuxPagingImprovements) Apply() error
Apply sets the new values in the system
func (LinuxPagingImprovements) Initialise ¶
func (paging LinuxPagingImprovements) Initialise() (Note, error)
Initialise reads the parameter values from current system
func (LinuxPagingImprovements) Name ¶
func (paging LinuxPagingImprovements) Name() string
Name returns the name of the related SAP Note
func (LinuxPagingImprovements) Optimise ¶
func (paging LinuxPagingImprovements) Optimise() (Note, error)
Optimise gets the expected pagecache values from the configuration or calculates new values
type Note ¶
type Note interface { Initialise() (Note, error) // Inspect all tuning parameters and return. Optimise() (Note, error) // (Re)calculate all parameters, but do not apply. Apply() error // Apply all tuning parameters without further calculation. Name() string // The original note name. }
Note defines the structure and actions for a SAP Note An SAP note consisting of a series of tunable parameters that can be applied and reverted. Parameter is immutable. Internal state changes can only be made to copies.
type ParameterNoteEntry ¶
ParameterNoteEntry stores the parameter values set by a Note
type ParameterNotes ¶
type ParameterNotes struct {
AllNotes []ParameterNoteEntry
}
ParameterNotes includes a list of applied notes, which manipulate the given system parameter the entries are stored in exactly the order the Notes were applied. So you get a (timeline) chain of applied parameter values
func GetSavedParameterNotes ¶
func GetSavedParameterNotes(param string) ParameterNotes
GetSavedParameterNotes reads content of stored parameter states. Return the content as ParameterNotes
type TuningOptions ¶
TuningOptions is the collection of tuning options from SAP notes and 3rd party vendors.
func GetTuningOptions ¶
func GetTuningOptions(saptuneTuningDir, thirdPartyTuningDir string) TuningOptions
GetTuningOptions returns all built-in tunable SAP notes together with those defined by 3rd party vendors.
func (*TuningOptions) GetSortedIDs ¶
func (opts *TuningOptions) GetSortedIDs() (ret []string)
GetSortedIDs returns all tuning option IDs, sorted in ascending order.