public class GovernorOnDemand extends GovernorCommonBase
This governor extends the GovernorCommonBase
one, which includes
a set of parameters that can be configured.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_SAMPLING_DOWN_FACTOR
Maximum sampling down factor: 100000.
|
static int |
MIN_UP_THRESHOLD
Minimum up threshold: 10.
|
MAX_SAMPLING_RATE
governorType, handler, PATH_GOVERNOR_SETTINGS
Modifier and Type | Method and Description |
---|---|
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 |
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_UP_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 <= MIN_UP_THRESHOLD
or
if threshold > 100
.MIN_UP_THRESHOLD
,
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()
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.