X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_CPTA.py;h=0c317c05ce4987a138f08c2c76f6f5b2b4d4e61b;hp=8ae0662e365e1a5936697feb94333ce8795903be;hb=5ae1aea05849a69a97f559756e80b9794482f302;hpb=0354ec6ac7b0c633a9f4c7007c0cba43bc05acbd diff --git a/resources/tools/presentation/generator_CPTA.py b/resources/tools/presentation/generator_CPTA.py index 8ae0662e36..0c317c05ce 100644 --- a/resources/tools/presentation/generator_CPTA.py +++ b/resources/tools/presentation/generator_CPTA.py @@ -313,8 +313,9 @@ def _generate_trending_traces(in_data, period, moving_win_size=10, traces.append(trace_anomalies) if show_moving_median: + min_periods = moving_win_size / 2 + 1 data_mean_y = pd.Series(data_y).rolling( - window=moving_win_size).median() + window=moving_win_size, min_periods=min_periods).median() trace_median = plgo.Scatter( x=data_x, y=data_mean_y, @@ -324,7 +325,7 @@ def _generate_trending_traces(in_data, period, moving_win_size=10, "width": 1, "color": color, }, - name='{name}-trend'.format(name=name, size=moving_win_size) + name='{name}-trend'.format(name=name) ) traces.append(trace_median) @@ -388,7 +389,7 @@ def _generate_all_charts(spec, input_data): chart_data[test_name][int(idx)] = \ test["result"]["throughput"] except (KeyError, TypeError): - chart_data[test_name][int(idx)] = None + pass # Add items to the csv table: for tst_name, tst_data in chart_data.items(): @@ -462,9 +463,8 @@ def _generate_all_charts(spec, input_data): result = "PASS" elif item == 0.33 or item == 0.0: result = "FAIL" - print(results) - print(result) - if result == "FAIL": - return 1 - else: - return 0 + + logging.info("Partial results: {0}".format(results)) + logging.info("Result: {0}".format(result)) + + return result