diff options
author | Tibor Frank <tifrank@cisco.com> | 2020-05-06 14:38:29 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2020-05-07 05:21:08 +0000 |
commit | fea2bbe7edc613963ebe7db1029b8a108c5e7eed (patch) | |
tree | bdb16cdd337d29281a43c4c25f1b01b1d2ff74cd /resources/tools/presentation/pal_utils.py | |
parent | bd716f25e6f8f0b70741551cfbff91fb061ee395 (diff) |
Trending: NDRPDR dashboard
Change-Id: I7f4c84dd47874c484f34f389b93de635c66a77c1
Signed-off-by: Tibor Frank <tifrank@cisco.com>
(cherry picked from commit 48cd54ff00049d58494834d25d3f0ac846ce4017)
(cherry picked from commit 8cd8cd07576857ba9c5d75059889f011fb2881dd)
Diffstat (limited to 'resources/tools/presentation/pal_utils.py')
-rw-r--r-- | resources/tools/presentation/pal_utils.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/resources/tools/presentation/pal_utils.py b/resources/tools/presentation/pal_utils.py index 98d5837989..86a6679918 100644 --- a/resources/tools/presentation/pal_utils.py +++ b/resources/tools/presentation/pal_utils.py @@ -262,7 +262,7 @@ def classify_anomalies(data): :param data: Full data set with unavailable samples replaced by nan. :type data: OrderedDict :returns: Classification and trend values - :rtype: 2-tuple, list of strings and list of floats + :rtype: 3-tuple, list of strings, list of floats and list of floats """ # Nan means something went wrong. # Use 0.0 to cause that being reported as a severe regression. @@ -273,13 +273,16 @@ def classify_anomalies(data): group_list.reverse() # Just to use .pop() for FIFO. classification = [] avgs = [] + stdevs = [] active_group = None values_left = 0 avg = 0.0 + stdv = 0.0 for sample in data.values(): if np.isnan(sample): classification.append(u"outlier") avgs.append(sample) + stdevs.append(sample) continue if values_left < 1 or active_group is None: values_left = 0 @@ -287,14 +290,17 @@ def classify_anomalies(data): active_group = group_list.pop() values_left = len(active_group.run_list) avg = active_group.stats.avg + stdv = active_group.stats.stdev classification.append(active_group.comment) avgs.append(avg) + stdevs.append(stdv) values_left -= 1 continue classification.append(u"normal") avgs.append(avg) + stdevs.append(stdv) values_left -= 1 - return classification, avgs + return classification, avgs, stdevs def convert_csv_to_pretty_txt(csv_file_name, txt_file_name, delimiter=u","): |