216 |
|
* @param negateCheck whether to negate the check |
217 |
|
* @return the threshold level breached, if any |
218 |
|
*/ |
219 |
< |
private int checkAttributeThreshold(double diskInUse, Register reg, boolean negateCheck) { |
219 |
> |
private int checkAttributeThreshold(double value, Register reg, boolean negateCheck) { |
220 |
|
for(int thresholdLevel = Alert.thresholdLevels.length - 1; thresholdLevel >= 0; thresholdLevel--) { |
221 |
|
if (reg.getThreshold(thresholdLevel) != -1.0) { |
222 |
|
if(!negateCheck) { |
223 |
|
// normal check - has the value gone *over* the threshold |
224 |
< |
if(((double) reg.getThreshold(thresholdLevel)) < diskInUse) { |
224 |
> |
if(((double) reg.getThreshold(thresholdLevel)) < value) { |
225 |
|
return thresholdLevel; |
226 |
|
} |
227 |
|
} |
228 |
|
else { |
229 |
|
// negated check - has the value gone *under* the threshold |
230 |
< |
if(((double) reg.getThreshold(thresholdLevel)) > diskInUse) { |
230 |
> |
if(((double) reg.getThreshold(thresholdLevel)) > value) { |
231 |
|
return thresholdLevel; |
232 |
|
} |
233 |
|
} |