X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_tables.py;h=d42c734b9591185618be34a59f7fb95e6a779e49;hb=refs%2Fchanges%2F02%2F13202%2F44;hp=43117cc4ed40d19f31a21ab06659fa1d5d8f4a0a;hpb=2e63ef13b419da1198439617e66cb0f1cfe6be65;p=csit.git diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index 43117cc4ed..d42c734b95 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -17,7 +17,6 @@ import logging import csv -import pandas as pd from string import replace from collections import OrderedDict @@ -185,6 +184,8 @@ def table_performance_improvements(table, input_data): """Generate the table(s) with algorithm: table_performance_improvements specified in the specification file. + # FIXME: Not used now. + :param table: Table to generate. :param input_data: Data to process. :type table: pandas.Series @@ -611,7 +612,7 @@ def table_performance_comparison_mrr(table, input_data): "cmp-data": list()} try: tbl_dict[tst_name]["ref-data"].\ - append(tst_data["result"]["throughput"]) + append(tst_data["result"]["receive-rate"].avg) except TypeError: pass # No data in output.xml for this test @@ -620,7 +621,7 @@ def table_performance_comparison_mrr(table, input_data): for tst_name, tst_data in data[job][str(build)].iteritems(): try: tbl_dict[tst_name]["cmp-data"].\ - append(tst_data["result"]["throughput"]) + append(tst_data["result"]["receive-rate"].avg) except KeyError: pass except TypeError: @@ -723,21 +724,21 @@ def table_performance_trending_dashboard(table, input_data): "data": OrderedDict()} try: tbl_dict[tst_name]["data"][str(build)] = \ - tst_data["result"]["throughput"] + tst_data["result"]["receive-rate"] except (TypeError, KeyError): pass # No data in output.xml for this test tbl_lst = list() for tst_name in tbl_dict.keys(): - if len(tbl_dict[tst_name]["data"]) < 2: + data_t = tbl_dict[tst_name]["data"] + if len(data_t) < 2: continue - data_t = pd.Series(tbl_dict[tst_name]["data"]) - classification_lst, avgs = classify_anomalies(data_t) - win_size = min(data_t.size, table["window"]) - long_win_size = min(data_t.size, table["long-trend-window"]) + win_size = min(len(data_t), table["window"]) + long_win_size = min(len(data_t), table["long-trend-window"]) + try: max_long_avg = max( [x for x in avgs[-long_win_size:-win_size] @@ -970,10 +971,10 @@ def table_failed_tests(table, input_data): # Prepare the header of the tables header = ["Test Case", - "Fails [#]", - "Last Fail [Timestamp]", - "Last Fail [VPP Build]", - "Last Fail [CSIT Build]"] + "Failures [#]", + "Last Failure [Time]", + "Last Failure [VPP-Build-Id]", + "Last Failure [CSIT-Job-Build-Id]"] # Generate the data for the table according to the model in the table # specification @@ -1070,14 +1071,9 @@ def table_failed_tests_html(table, input_data): th.text = item # Rows: - colors = {"very-bad": ("#ffcccc", "#ff9999"), - "bad": ("#e9f1fb", "#d4e4f7")} + colors = ("#e9f1fb", "#d4e4f7") for r_idx, row in enumerate(csv_lst[1:]): - if int(row[1]) > 7: - color = "very-bad" - else: - color = "bad" - background = colors[color][r_idx % 2] + background = colors[r_idx % 2] tr = ET.SubElement(failed_tests, "tr", attrib=dict(bgcolor=background)) # Columns: