diff options
author | Maryam Tahhan <maryam.tahhan@intel.com> | 2016-02-19 17:04:26 +0000 |
---|---|---|
committer | Maryam Tahhan <maryam.tahhan@intel.com> | 2016-02-23 14:47:47 +0000 |
commit | 0b43a0141b5b5e85bf1f1c5661c0ec2d96ed79c5 (patch) | |
tree | 69e9afe55446b045452c45dbf60eed005f569728 /tools/pkt_gen/dummy | |
parent | ff1634c7e034dc9ef8ef779c1b3aa74019af1ac7 (diff) |
Results: Report percentage frameloss from Dummy
This patch adds the frameloss % result reporting to the dummy traffic
gen and fixes incorrect calculations in the past for mbps that don't
convert packet sizes to bits.
JIRA: VSPERF-201
Change-Id: Ic4fc64a981ecbed0ab956f1cb94c7d76e7868def
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com>
Reviewed-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Diffstat (limited to 'tools/pkt_gen/dummy')
-rwxr-xr-x | tools/pkt_gen/dummy/dummy.py | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/tools/pkt_gen/dummy/dummy.py b/tools/pkt_gen/dummy/dummy.py index dab59bea..5a117850 100755 --- a/tools/pkt_gen/dummy/dummy.py +++ b/tools/pkt_gen/dummy/dummy.py @@ -147,25 +147,25 @@ class Dummy(trafficgen.ITrafficGenerator): 'continuous', '%dmpps, multistream %s duration %d' % (traffic['frame_rate'], multistream, duration), traffic_, - ('frames tx', 'frames rx', 'min latency', 'max latency', - 'avg latency')) + ('frames tx', 'frames rx', 'tx rate %','rx rate %' ,'min latency', + 'max latency','avg latency', 'frameloss %')) framesize = traffic_['l2']['framesize'] - # builds results by using user-supplied values where possible + # builds results by using user-supplied values # and guessing remainder using available info result[ResultsConstants.TX_RATE_FPS] = float(results[0]) / duration result[ResultsConstants.THROUGHPUT_RX_FPS] = float(results[1]) / duration - result[ResultsConstants.TX_RATE_MBPS] = (float(results[0]) \ - * framesize) / duration - result[ResultsConstants.THROUGHPUT_RX_MBPS] = (float(results[1]) \ - * framesize) / duration - result[ResultsConstants.TX_RATE_PERCENT] = 0.0 - result[ResultsConstants.THROUGHPUT_RX_PERCENT] = 0.0 - result[ResultsConstants.MIN_LATENCY_NS] = float(results[2]) - result[ResultsConstants.MAX_LATENCY_NS] = float(results[3]) - result[ResultsConstants.AVG_LATENCY_NS] = float(results[4]) - + result[ResultsConstants.TX_RATE_MBPS] = (float(results[0]) / duration) \ + * (framesize * 8 / 1000000) + result[ResultsConstants.THROUGHPUT_RX_MBPS] = (float(results[1]) / duration) \ + * (framesize * 8 / 1000000) + result[ResultsConstants.TX_RATE_PERCENT] = float(results[2]) + result[ResultsConstants.THROUGHPUT_RX_PERCENT] = float(results[3]) + result[ResultsConstants.MIN_LATENCY_NS] = float(results[4]) + result[ResultsConstants.MAX_LATENCY_NS] = float(results[5]) + result[ResultsConstants.AVG_LATENCY_NS] = float(results[6]) + result[ResultsConstants.FRAME_LOSS_PERCENT] = float(results[7]) return result def send_rfc2544_throughput(self, traffic=None, trials=3, duration=20, @@ -185,29 +185,28 @@ class Dummy(trafficgen.ITrafficGenerator): '%s' % (trials, duration, lossrate, 'enabled' if multistream else 'disabled'), traffic_, - ('frames tx', 'frames rx', 'min latency', 'max latency', - 'avg latency')) + ('frames tx', 'frames rx', 'tx rate %','rx rate %' ,'min latency', + 'max latency','avg latency', 'frameloss %')) framesize = traffic_['l2']['framesize'] - # builds results by using user-supplied values where possible + # builds results by using user-supplied values # and guessing remainder using available info - result[ResultsConstants.TX_RATE_FPS] = float(results[0]) \ - / duration - result[ResultsConstants.THROUGHPUT_RX_FPS] = float(results[1]) \ - / duration - result[ResultsConstants.TX_RATE_MBPS] = (float(results[0]) \ - * framesize) / duration - result[ResultsConstants.THROUGHPUT_RX_MBPS] = (float(results[1]) \ - * framesize) / duration - result[ResultsConstants.TX_RATE_PERCENT] = 0.0 - result[ResultsConstants.THROUGHPUT_RX_PERCENT] = 0.0 - result[ResultsConstants.MIN_LATENCY_NS] = float(results[2]) - result[ResultsConstants.MAX_LATENCY_NS] = float(results[3]) - result[ResultsConstants.AVG_LATENCY_NS] = float(results[4]) - + result[ResultsConstants.TX_RATE_FPS] = float(results[0]) / duration + result[ResultsConstants.THROUGHPUT_RX_FPS] = float(results[1]) / duration + result[ResultsConstants.TX_RATE_MBPS] = (float(results[0]) / duration) \ + * (framesize * 8 / 1000000) + result[ResultsConstants.THROUGHPUT_RX_MBPS] = (float(results[1]) / duration) \ + * (framesize * 8 / 1000000) + result[ResultsConstants.TX_RATE_PERCENT] = float(results[2]) + result[ResultsConstants.THROUGHPUT_RX_PERCENT] = float(results[3]) + result[ResultsConstants.MIN_LATENCY_NS] = float(results[4]) + result[ResultsConstants.MAX_LATENCY_NS] = float(results[5]) + result[ResultsConstants.AVG_LATENCY_NS] = float(results[6]) + result[ResultsConstants.FRAME_LOSS_PERCENT] = float(results[7]) return result + if __name__ == '__main__': TRAFFIC = { 'l3': { |