aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen/dummy
diff options
context:
space:
mode:
authorMaryam Tahhan <maryam.tahhan@intel.com>2015-11-08 17:35:50 -0500
committerMaryam Tahhan <maryam.tahhan@intel.com>2015-12-02 13:47:36 +0000
commit0c292cdcf82ca1d5a71a93c1e1f91cb061a2c6f2 (patch)
tree988973cdfaa43f705856d31157967fab9afb178d /tools/pkt_gen/dummy
parent0606ef6290ac1e41468f57b0ef2ff1d0571aee3e (diff)
pkt_gen: add duration to all send functions
Allow a configurable duration for all send functions. JIRA: VSPERF-125 Change-Id: I7c6f5d136a7d7100e3990f7fdc00121b07081a80 Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com> Reviewed-by: Dino Simeon Madarang <dino.simeonx.madarang@intel.com> Reviewed-by: Radek Zetik <radekx.zetik@intel.com>
Diffstat (limited to 'tools/pkt_gen/dummy')
-rwxr-xr-xtools/pkt_gen/dummy/dummy.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/pkt_gen/dummy/dummy.py b/tools/pkt_gen/dummy/dummy.py
index bf5a8f3c..33c7eec9 100755
--- a/tools/pkt_gen/dummy/dummy.py
+++ b/tools/pkt_gen/dummy/dummy.py
@@ -104,7 +104,7 @@ class Dummy(trafficgen.ITrafficGenerator):
"""
pass
- def send_burst_traffic(self, traffic=None, numpkts=100, time=20):
+ def send_burst_traffic(self, traffic=None, numpkts=100, duration=20):
"""
Send a burst of traffic.
"""
@@ -116,7 +116,7 @@ class Dummy(trafficgen.ITrafficGenerator):
results = get_user_traffic(
'burst',
- '%dpkts, %dmS' % (numpkts, time),
+ '%dpkts, %dmS' % (numpkts, duration),
traffic_,
('frames rx', 'payload errors', 'sequence errors'))
@@ -133,7 +133,7 @@ class Dummy(trafficgen.ITrafficGenerator):
return trafficgen.BurstResult(*results)
- def send_cont_traffic(self, traffic=None, time=20, multistream=False):
+ def send_cont_traffic(self, traffic=None, duration=30, multistream=False):
"""
Send a continuous flow of traffic.
"""
@@ -145,8 +145,8 @@ class Dummy(trafficgen.ITrafficGenerator):
results = get_user_traffic(
'continuous',
- '%dmS, %dmpps, multistream %s' % (time, traffic['frame_rate'],
- multistream), traffic_,
+ '%dmpps, multistream %s duration %d' % (traffic['frame_rate'],
+ multistream, duration), traffic_,
('frames tx', 'frames rx', 'min latency', 'max latency',
'avg latency'))
@@ -154,12 +154,12 @@ class Dummy(trafficgen.ITrafficGenerator):
# builds results by using user-supplied values where possible
# and guessing remainder using available info
- result[ResultsConstants.THROUGHPUT_TX_FPS] = float(results[0]) / time
- result[ResultsConstants.THROUGHPUT_RX_FPS] = float(results[1]) / time
+ result[ResultsConstants.THROUGHPUT_TX_FPS] = float(results[0]) / duration
+ result[ResultsConstants.THROUGHPUT_RX_FPS] = float(results[1]) / duration
result[ResultsConstants.THROUGHPUT_TX_MBPS] = (float(results[0]) \
- * framesize) / time
+ * framesize) / duration
result[ResultsConstants.THROUGHPUT_RX_MBPS] = (float(results[1]) \
- * framesize) / time
+ * framesize) / duration
result[ResultsConstants.THROUGHPUT_TX_PERCENT] = 0.0
result[ResultsConstants.THROUGHPUT_RX_PERCENT] = 0.0
result[ResultsConstants.MIN_LATENCY_NS] = float(results[2])