public class GovernorConservative extends GovernorCommonBase
Like the 'ondemand' one, this governor extends the
GovernorCommonBase
and includes some other parameters that can be
configured.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_SAMPLING_DOWN_FACTOR
Maximum sampling down factor: 10.
|
static int |
MIN_DOWN_THRESHOLD
Minimum down threshold: 11.
|
MAX_SAMPLING_RATE
governorType, handler, PATH_GOVERNOR_SETTINGS
Modifier and Type | Method and Description |
---|---|
int |
getDownThreshold()
Gets the down threshold percentage.
|
int |
getFreqStep()
Gets the frequency step percentage.
|
protected int |
getSamplingDownFactorMaxValue()
Returns the maximum limit for the sampling down factor.
|
protected java.lang.String |
getTag()
Returns the class tag used for logging purposes.
|
protected int |
getUpThresholdMinValue()
Returns the minimum limit for the up threshold percentage.
|
void |
setDownThreshold(int threshold)
Sets the down threshold percentage.
|
void |
setFreqStep(int frequency)
Sets the frequency step percentage.
|
void |
setSamplingDownFactor(int factor)
Sets the sampling down factor.
|
void |
setUpThreshold(int threshold)
Sets the up threshold percentage.
|
disableIgnoreNiceLoad, enableIgnoreNiceLoad, getIgnoreNiceLoad, getMinSamplingRate, getSamplingDownFactor, getSamplingRate, getUpThreshold, setSamplingRate
getGovernorType, getSettingPath, readFile, writeFile
public static final int MIN_DOWN_THRESHOLD
public static final int MAX_SAMPLING_DOWN_FACTOR
protected java.lang.String getTag()
Governor
public void setUpThreshold(int threshold) throws CPUException
For example when it is set to its default value of '95' it means that between the checking intervals the CPU needs to be on average more than 95% in use to then decide that the CPU frequency needs to be increased.
setUpThreshold
in class GovernorCommonBase
threshold
- The up threshold percentage.CPUException
- If there is an error during the configuration
process.java.lang.IllegalArgumentException
- If threshold <= getDownThreshold()
or
if threshold > 100
.getDownThreshold()
,
GovernorCommonBase.getUpThreshold()
public void setSamplingDownFactor(int factor) throws CPUException
setSamplingDownFactor
in class GovernorCommonBase
factor
- The new sampling down factor.CPUException
- If there is an error during the configuration
process.java.lang.IllegalArgumentException
- If factor < 1
or
if factor > MAX_SAMPLING_DOWN_FACTOR
.MAX_SAMPLING_DOWN_FACTOR
,
GovernorCommonBase.getSamplingDownFactor()
public void setDownThreshold(int threshold) throws CPUException
For example when it is set to its default value of '20' it means that the CPU usage needs to be below 20% between samples to have the frequency decreased.
threshold
- The down threshold percentage.CPUException
- If there is an error during the configuration
process.java.lang.IllegalArgumentException
- If threshold < MIN_DOWN_THRESHOLD
or
if threshold >= getUpThreshold()
.MIN_DOWN_THRESHOLD
,
getDownThreshold()
,
GovernorCommonBase.getUpThreshold()
public int getDownThreshold() throws CPUException
CPUException
- If there is an error during the configuration
process.setDownThreshold(int)
public void setFreqStep(int frequency) throws CPUException
You can change this value to anywhere between 0 and 100 where '0' will effectively lock your CPU at a speed regardless of its load whilst '100' will, in theory, make it behave identically to the 'ondemand' governor.
frequency
- The new frequency step percentage.CPUException
- If there is an error during the configuration
process.java.lang.IllegalArgumentException
- If frequency < 0
or
if frequency > 100
.getFreqStep()
public int getFreqStep() throws CPUException
CPUException
- If there is an error during the configuration
process.setFreqStep(int)
protected int getSamplingDownFactorMaxValue()
GovernorCommonBase
getSamplingDownFactorMaxValue
in class GovernorCommonBase
protected int getUpThresholdMinValue() throws CPUException
GovernorCommonBase
getUpThresholdMinValue
in class GovernorCommonBase
CPUException
- If there is an error while calculating the minimum
limit.