def _check_metric_threshold()

in CommonLayerCode/datalake-library/python/datalake_library/octagon/metric.py [0:0]


    def _check_metric_threshold(self, current_value, evaluation, threshold_value):

        throw_if_false(isinstance(current_value, int), "Wrong current value")
        throw_if_false(isinstance(threshold_value, int), "Wrong threshold value")

        if evaluation == "=":
            return current_value == threshold_value
        elif evaluation == ">":
            return current_value > threshold_value
        elif evaluation == "<":
            return current_value < threshold_value
        elif evaluation == ">=":
            return current_value >= threshold_value
        elif evaluation == "<=":
            return current_value <= threshold_value
        else:
            raise ValueError(f"Wrong evaluation operation: {evaluation}")