aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2021-07-23 11:05:04 +0200
committerTibor Frank <tifrank@cisco.com>2021-07-23 09:06:55 +0000
commit153e08a43ad8d79dbea66e7dafe2530286d3c5cc (patch)
treefb36182dccdbd2685b49e049279337f4cb59e0dc
parenta3e471c73108b712d9fed80da68cce3211146720 (diff)
Trending: Add exception handling for anomalies classification
Change-Id: I6f2ee7552c513ccf2fa453f143dd52ea880bd412 Signed-off-by: Tibor Frank <tifrank@cisco.com> (cherry picked from commit 1da19da813655f643bc3c6e4d03bed987f076f07)
-rw-r--r--resources/tools/presentation/generator_cpta.py7
-rw-r--r--resources/tools/presentation/generator_tables.py3
2 files changed, 9 insertions, 1 deletions
diff --git a/resources/tools/presentation/generator_cpta.py b/resources/tools/presentation/generator_cpta.py
index db64d5ffae..4b10440257 100644
--- a/resources/tools/presentation/generator_cpta.py
+++ b/resources/tools/presentation/generator_cpta.py
@@ -244,7 +244,12 @@ def _generate_trending_traces(in_data, job_name, build_info,
for key, value in zip(xaxis, data_y_pps):
data_pd[key] = value
- anomaly_classification, avgs_pps, stdevs_pps = classify_anomalies(data_pd)
+ try:
+ anomaly_classification, avgs_pps, stdevs_pps = \
+ classify_anomalies(data_pd)
+ except ValueError as err:
+ logging.info(f"{err} Skipping")
+ return
avgs_mpps = [avg_pps / 1e6 for avg_pps in avgs_pps]
stdevs_mpps = [stdev_pps / 1e6 for stdev_pps in stdevs_pps]
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py
index a715ecb800..449b2357a8 100644
--- a/resources/tools/presentation/generator_tables.py
+++ b/resources/tools/presentation/generator_tables.py
@@ -1234,6 +1234,9 @@ def table_perf_trending_dash_html(table, input_data):
try:
with open(table[u"input-file"], u'rt') as csv_file:
csv_lst = list(csv.reader(csv_file, delimiter=u',', quotechar=u'"'))
+ except FileNotFoundError as err:
+ logging.warning(f"{err}")
+ return
except KeyError:
logging.warning(u"The input file is not defined.")
return