private AlertState stateWhenDirectionUp(double value) {
    if (value >= critValue) {
      return AlertState.CRITICAL;
    }
    if (value >= warnValue) {
      return AlertState.WARNING;
    }
    if (okValue == null || value >= okValue) {
      return AlertState.OK;
    }
    return AlertState.UNKNOWN;
  }
I'm a 3 level threshold where each level corresponds to ok, warn and critical levels.
The levels are either increasing or decreasing numerical sequences.
My main responsibility is to map incoming values to {@link AlertState} based on the threshold levels.
ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java