Report: Fix header of comp tables, add data
[csit.git] / resources / tools / presentation / generator_tables.py
index 08c9d55..c745be8 100644 (file)
@@ -611,6 +611,8 @@ def _tpc_generate_html_table(header, data, out_file_name, legend=u"",
             f'src="../..{out_file_name.replace(u"_build", u"")}_in.html">'
             f'</iframe>\n\n'
         )
+
+        # TODO: Use html (rst) list for legend and footnote
         if legend:
             rst_file.write(legend[1:].replace(u"\n", u" |br| "))
         if footnote:
@@ -667,8 +669,7 @@ def table_soak_vs_ndr(table, input_data):
             f"Percentage change calculated for mean values.\n"
             u"Stdev(Diff): "
             u"Standard deviation of percentage change calculated for mean "
-            u"values.\n"
-            u":END"
+            u"values."
         )
     except (AttributeError, KeyError) as err:
         logging.error(f"The model is invalid, missing parameter: {repr(err)}")
@@ -866,7 +867,7 @@ def table_perf_trending_dash(table, input_data):
         if len(data_t) < 2:
             continue
 
-        classification_lst, avgs = classify_anomalies(data_t)
+        classification_lst, avgs, _ = classify_anomalies(data_t)
 
         win_size = min(len(data_t), table[u"window"])
         long_win_size = min(len(data_t), table[u"long-trend-window"])
@@ -903,8 +904,8 @@ def table_perf_trending_dash(table, input_data):
                  round(last_avg / 1e6, 2),
                  rel_change_last,
                  rel_change_long,
-                 classification_lst[-win_size:].count(u"regression"),
-                 classification_lst[-win_size:].count(u"progression")])
+                 classification_lst[-win_size+1:].count(u"regression"),
+                 classification_lst[-win_size+1:].count(u"progression")])
 
     tbl_lst.sort(key=lambda rel: rel[0])
 
@@ -1155,7 +1156,7 @@ def table_perf_trending_dash_html(table, input_data):
                 attrib=dict(align=u"left" if c_idx == 0 else u"center")
             )
             # Name:
-            if c_idx == 0:
+            if c_idx == 0 and table.get(u"add-links", True):
                 ref = ET.SubElement(
                     tdata,
                     u"a",
@@ -1756,8 +1757,6 @@ def table_comparison(table, input_data):
     with open(txt_file_name, u'a', encoding='utf-8') as txt_file:
         txt_file.write(legend)
         txt_file.write(footnote)
-        if legend or footnote:
-            txt_file.write(u"\n:END")
 
     # Generate html table:
     _tpc_generate_html_table(