Package com.github.ambry.commons
Class Thresholds
- java.lang.Object
-
- com.github.ambry.commons.Thresholds
-
public class Thresholds extends java.lang.Object
A data structure holding various thresholds based on different criteria.
-
-
Constructor Summary
Constructors Constructor Description Thresholds(java.util.Map<PerformanceIndex,Criteria> perfIndicesAndCriteria)
Thresholds constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkThresholds(java.util.Map<PerformanceIndex,java.lang.Long> dataToCheck)
Check if input data satisfy all thresholds.Criteria
getCriteria(PerformanceIndex performanceIndex)
Get theCriteria
associated with the specifiedPerformanceIndex
-
-
-
Constructor Detail
-
Thresholds
public Thresholds(java.util.Map<PerformanceIndex,Criteria> perfIndicesAndCriteria)
Thresholds constructor- Parameters:
perfIndicesAndCriteria
- a map that holdsPerformanceIndex
and itsCriteria
. Criteria is a data structure that holds the bounds of threshold and helps to check if measured value meets the requirement(threshold).
-
-
Method Detail
-
checkThresholds
public boolean checkThresholds(java.util.Map<PerformanceIndex,java.lang.Long> dataToCheck)
Check if input data satisfy all thresholds.- Parameters:
dataToCheck
- a map whose key isPerformanceIndex
and value is corresponding measured number.- Returns:
true
if thresholds are satisfied.false
otherwise.
-
getCriteria
public Criteria getCriteria(PerformanceIndex performanceIndex)
Get theCriteria
associated with the specifiedPerformanceIndex
- Parameters:
performanceIndex
- to which the criteria is related- Returns:
- the criteria or null if it doesn't exist
-
-