From 0b43a0141b5b5e85bf1f1c5661c0ec2d96ed79c5 Mon Sep 17 00:00:00 2001 From: Maryam Tahhan Date: Fri, 19 Feb 2016 17:04:26 +0000 Subject: 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 Reviewed-by: Billy O Mahony Reviewed-by: Martin Klozik Reviewed-by: Al Morton --- tools/pkt_gen/dummy/dummy.py | 59 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 30 deletions(-) (limited to 'tools/pkt_gen') 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': { -- cgit 1.2.3-korg