def _calculate(self, failures, total):
        if self.is_success_cnt:
            value = total - failures
        else:
            value = failures
        if self.is_percentage:
            if not total:
                return 0
            value = (value * 100)/total
        return value
Calculate the metric value.
dataset/ETHPy150Open django/django-dev-dashboard/dashboard/models.py/JenkinsFailuresMetric._calculate