- tmp_classification = "outlier" if classification == "failure" \
- else classification
- for idx in range(first_idx, len(classification_lst)):
- if classification_lst[idx] == tmp_classification:
- index = idx
- break
- for idx in range(index+1, len(classification_lst)):
- if classification_lst[idx] == tmp_classification:
- if rel_change_lst[idx] > rel_change_lst[index]:
- index = idx
-
- trend = round(float(median_lst[-1]) / 1000000, 2) \
- if not isnan(median_lst[-1]) else '-'
- sample = round(float(sample_lst[index]) / 1000000, 2) \
- if not isnan(sample_lst[index]) else '-'
- rel_change = rel_change_lst[index] \
- if rel_change_lst[index] is not None else '-'
- if not isnan(max_median):
- if not isnan(sample_lst[index]):
- long_trend_threshold = max_median * \
- (table["long-trend-threshold"] / 100)
- if sample_lst[index] < long_trend_threshold:
- long_trend_classification = "failure"
- else:
- long_trend_classification = '-'
- else:
- long_trend_classification = "failure"
+ rel_change_last = round(
+ ((last_median_t - median_t_14) / median_t_14) * 100, 2)
+
+ if isnan(max_median) or isnan(last_median_t) or max_median == 0.0:
+ rel_change_long = nan