Pair<Integer, List<Condition>> resultPair = queryCheckMinuteAndConditions(configs);
int maxMinute = resultPair.getKey();
List<Condition> conditions = resultPair.getValue();
if (minute >= maxMinute - 1) {
MetricReport report = fetchMetricReport(product, ModelPeriod.CURRENT);
if (report != null) {
int start = minute + 1 - maxMinute;
int end = minute;
value = queryRealData(start, end, metricKey, report, type);
baseline = queryBaseLine(start, end, metricKey, new Date(ModelPeriod.CURRENT.getStartTime()), type);
return m_dataChecker.checkData(value, baseline, conditions);
}
} else if (minute < 0) {
MetricReport lastReport = fetchMetricReport(product, ModelPeriod.LAST);
if (lastReport != null) {
int start = 60 + minute + 1 - (maxMinute);
int end = 60 + minute;
value = queryRealData(start, end, metricKey, lastReport, type);
baseline = queryBaseLine(start, end, metricKey, new Date(ModelPeriod.LAST.getStartTime()), type);
return m_dataChecker.checkData(value, baseline, conditions);
}
} else {
MetricReport currentReport = fetchMetricReport(product, ModelPeriod.CURRENT);
MetricReport lastReport = fetchMetricReport(product, ModelPeriod.LAST);
if (currentReport != null && lastReport != null) {
int currentStart = 0, currentEnd = minute;
double[] currentValue = queryRealData(currentStart, currentEnd, metricKey, currentReport, type);
double[] currentBaseline = queryBaseLine(currentStart, currentEnd, metricKey,