Add a configurable pause between runs during NDR/PDR binary search 41/57541/1 1.4.2
authorMichael Pedersen <michael.soelvkaer@gmail.com>
Thu, 17 May 2018 16:18:40 +0000 (09:18 -0700)
committerMichael Pedersen <michael.soelvkaer@gmail.com>
Thu, 17 May 2018 16:20:45 +0000 (09:20 -0700)
JIRA: NFVBENCH-93

Change-Id: I4328d51c934b62acba7b300426c25469dd69e598
Signed-off-by: Michael Pedersen <michael.soelvkaer@gmail.com>
nfvbench/cfg.default.yaml
nfvbench/nfvbench.py
nfvbench/traffic_client.py
test/test_nfvbench.py

index da68571..2af6d63 100755 (executable)
@@ -359,6 +359,9 @@ duration_sec: 60
 # Can be overridden by --interval
 interval_sec: 10
 
+# Default pause between iterations of a binary search (NDR/PDR)
+pause_sec: 2
+
 # NDR / PDR configuration
 measurement:
     # Drop rates represent the ratio of dropped packet to the total number of packets sent.
index 1f80390..e0b5786 100644 (file)
@@ -177,6 +177,7 @@ class NFVBench(object):
 
         self.config.duration_sec = float(self.config.duration_sec)
         self.config.interval_sec = float(self.config.interval_sec)
+        self.config.pause_sec = float(self.config.pause_sec)
 
         # Get traffic generator profile config
         if not self.config.generator_profile:
index 188e076..ef68fe5 100755 (executable)
@@ -754,6 +754,7 @@ class TrafficClient(object):
             time_elapsed_ratio = self.runner.time_elapsed() / self.run_config['duration_sec']
             if time_elapsed_ratio >= 1:
                 self.cancel_traffic()
+                time.sleep(self.config.pause_sec)
         self.interval_collector.reset()
 
         # get stats from the run
index c45ccb3..4603ae1 100644 (file)
@@ -623,6 +623,7 @@ def get_dummy_tg_config(chain_type, rate):
         'no_arp': False,
         'duration_sec': 1,
         'interval_sec': 1,
+        'pause_sec': 1,
         'rate': rate,
         'check_traffic_time_sec': 200,
         'generic_poll_sec': 2,