summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-04-29 00:40:13 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-04-29 00:40:13 +0300
commit3e90b0a09dc2abdb123684e3abd4041be41b9288 (patch)
tree8bdff4b596b685b774c6046b1b770ac41cce09fc /scripts
parent101c7b8b5f1e7e9eeb4df9d79e68c15cd0d49ef7 (diff)
regression: stl benchmark less strict stabilization
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/automation/regression/stateless_tests/stl_benchmark_test.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/automation/regression/stateless_tests/stl_benchmark_test.py b/scripts/automation/regression/stateless_tests/stl_benchmark_test.py
index 9bf20579..6614b1a6 100755
--- a/scripts/automation/regression/stateless_tests/stl_benchmark_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_benchmark_test.py
@@ -23,6 +23,7 @@ class STLBenchmark_Test(CStlGeneral_Test):
self.stl_trex.reset()
self.stl_trex.clear_stats()
+ sleep(1)
self.stl_trex.add_streams(profile, ports = [0, 1])
self.stl_trex.start(ports = [0, 1], mult = '10%')
start_time = time()
@@ -30,7 +31,7 @@ class STLBenchmark_Test(CStlGeneral_Test):
for i in range(timeout + 1):
stats = self.stl_trex.get_stats()
cpu_utils.append(stats['global']['cpu_util'])
- if i > stabilize and min(cpu_utils) > max(cpu_utils) * 0.98:
+ if i > stabilize and min(cpu_utils) > max(cpu_utils) * 0.95:
break
sleep(0.5)
@@ -42,13 +43,15 @@ class STLBenchmark_Test(CStlGeneral_Test):
raise Exception('Too much queue_full: %s' % stats['global']['queue_full'])
if not cpu_utils[-1]:
raise Exception('CPU util is zero, last values: %s' % cpu_utils)
- bw_per_core = 2 * 2 * (100 / cpu_utils[-1]) * stats['global']['tx_bps'] / (ports * cores * 1e9)
- print('Done (%ss), CPU util: %4g, bw_per_core: %6sGb/core' % (int(time() - start_time), cpu_utils[-1], round(bw_per_core, 2)))
+ agv_cpu_util = sum(cpu_utils) / stabilize
+ bw_per_core = 2 * 2 * (100 / agv_cpu_util) * stats['global']['tx_bps'] / (ports * cores * 1e9)
+ print('Done (%ss), CPU util: %4g, bw_per_core: %6sGb/core' % (int(time() - start_time), agv_cpu_util, round(bw_per_core, 2)))
# TODO: add check of benchmark based on results from regression
def tearDown(self):
self.stl_trex.reset()
self.stl_trex.clear_stats()
+ sleep(1)
CStlGeneral_Test.tearDown(self)