CSIT-1041: Trending dashboard
[csit.git] / resources / tools / presentation / generator_tables.py
index 65bf6d5..81f022e 100644 (file)
@@ -588,6 +588,7 @@ def table_performance_trending_dashboard(table, input_data):
                          std())[-2]
             if isnan(last):
                 anomaly = "outlier"
+                last = list(pd_data)[-1]
             elif last < (trend - 3 * t_stdev):
                 anomaly = "regression"
             elif last > (trend + 3 * t_stdev):
@@ -595,14 +596,14 @@ def table_performance_trending_dashboard(table, input_data):
             else:
                 anomaly = "normal"
 
-            if not isnan(last) and not isnan(trend):
+            if not isnan(last) and not isnan(trend) and trend != 0:
                 # Change:
                 change = round(float(last - trend) / 1000000, 2)
                 # Relative change:
                 rel_change = int(relative_change(float(trend), float(last)))
 
                 tbl_lst.append([name,
-                                round(float(last) / 1000000, 2),
+                                round(float(trend) / 1000000, 2),
                                 change,
                                 rel_change,
                                 anomaly])