aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2019-05-15 08:53:42 +0200
committerTibor Frank <tifrank@cisco.com>2019-05-15 06:56:45 +0000
commit92a2b3d14ea551f0ac3023e94e8d233fcba7e29a (patch)
tree752b228b13d07040d3b5cbabe63c675d7402ca46
parent15912f9aadf9b55906f3b2886c9ee9c78b89f81f (diff)
CSIT-1504: Soak tests - box plots
- table: stdev, round deltas to 2 dec places Change-Id: I29cd1f7c9ba8ef73a8281d42ac9f6a06ed30bbdf Signed-off-by: Tibor Frank <tifrank@cisco.com> (cherry picked from commit fce7b4b339f7a79b80143bbd796460720489d694)
-rw-r--r--resources/tools/presentation/generator_tables.py25
-rw-r--r--resources/tools/presentation/specification.yaml4
-rw-r--r--resources/tools/presentation/utils.py8
3 files changed, 18 insertions, 19 deletions
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py
index 887ee72797..f4c3e54ce4 100644
--- a/resources/tools/presentation/generator_tables.py
+++ b/resources/tools/presentation/generator_tables.py
@@ -608,21 +608,24 @@ def table_soak_vs_ndr(table, input_data):
tbl_lst = list()
for tst_name in tbl_dict.keys():
item = [tbl_dict[tst_name]["name"], ]
- data_t = tbl_dict[tst_name]["ref-data"]
- if data_t:
- item.append(round(mean(data_t) / 1000000, 2))
- item.append(round(stdev(data_t) / 1000000, 2))
+ data_r = tbl_dict[tst_name]["ref-data"]
+ if data_r:
+ data_r_mean = mean(data_r)
+ item.append(round(data_r_mean / 1000000, 2))
+ item.append(round(stdev(data_r) / 1000000, 2))
else:
+ data_r_mean = None
item.extend([None, None])
- data_t = tbl_dict[tst_name]["cmp-data"]
- if data_t:
- item.append(round(mean(data_t) / 1000000, 2))
- item.append(round(stdev(data_t) / 1000000, 2))
+ data_c = tbl_dict[tst_name]["cmp-data"]
+ if data_c:
+ data_c_mean = mean(data_c)
+ item.append(round(data_c_mean / 1000000, 2))
+ item.append(round(stdev(data_c) / 1000000, 2))
else:
+ data_c_mean = None
item.extend([None, None])
- if item[-4] is not None and item[-2] is not None and item[-4] != 0:
- item.append(int(relative_change(float(item[-4]), float(item[-2]))))
- if len(item) == len(header):
+ if data_r_mean and data_c_mean is not None:
+ item.append(round(relative_change(data_r_mean, data_c_mean), 2))
tbl_lst.append(item)
# Sort the table according to the relative change
diff --git a/resources/tools/presentation/specification.yaml b/resources/tools/presentation/specification.yaml
index 5719b2396a..2b55499c94 100644
--- a/resources/tools/presentation/specification.yaml
+++ b/resources/tools/presentation/specification.yaml
@@ -4560,7 +4560,7 @@
# Soak test - 30min Soak Test (PLRsearch), boxes
- type: "plot"
title: "VPP Throughput: 30min Soak Test (PLRsearch) boxes"
- algorithm: "plot_soak_boxes"
+ algorithm: "plot_performance_box"
output-file-type: ".html"
output-file: "{DIR[STATIC,VPP]}/soak-test-1"
data: "plot-vpp-soak-2n-skx"
@@ -4583,7 +4583,7 @@
# Soak test - 30min Soak Test (PLRsearch), boxes
- type: "plot"
title: "VPP Throughput: 30min Soak Test (PLRsearch) boxes"
- algorithm: "plot_soak_boxes"
+ algorithm: "plot_performance_box"
output-file-type: ".html"
output-file: "{DIR[STATIC,VPP]}/soak-test-2"
data: "plot-vpp-soak-2n-skx"
diff --git a/resources/tools/presentation/utils.py b/resources/tools/presentation/utils.py
index 3fdec85774..c350fae135 100644
--- a/resources/tools/presentation/utils.py
+++ b/resources/tools/presentation/utils.py
@@ -24,8 +24,8 @@ import prettytable
from os import walk, makedirs, environ
from os.path import join, isdir
from shutil import move, Error
-from math import sqrt
from datetime import datetime
+from pandas import Series
from errors import PresentationError
from jumpavg.BitCountingClassifier import BitCountingClassifier
@@ -51,11 +51,7 @@ def stdev(items):
:returns: Stdev.
:rtype: float
"""
-
- avg = mean(items)
- variance = [(x - avg) ** 2 for x in items]
- stddev = sqrt(mean(variance))
- return stddev
+ return Series.std(Series(items))
def relative_change(nr1, nr2):