From 22ffe5b07adeb514572dc3db8b435ef4107e348b Mon Sep 17 00:00:00 2001 From: sridharkn Date: Wed, 4 May 2016 13:11:58 +0530 Subject: pkt_gen: Reporting FPS and MBPS from Spirent Testcenter Support for reporting FPS and MBPS (TX and RX) is added. JIRA: VSPERF-285 Change-Id: Ic4b6ca02368b1808f0f985e90099cdb0b41c2afa Signed-off-by: sridharkn --- tools/pkt_gen/testcenter/testcenter.py | 36 ++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'tools/pkt_gen/testcenter') diff --git a/tools/pkt_gen/testcenter/testcenter.py b/tools/pkt_gen/testcenter/testcenter.py index b1351155..2adf6c90 100644 --- a/tools/pkt_gen/testcenter/testcenter.py +++ b/tools/pkt_gen/testcenter/testcenter.py @@ -149,10 +149,20 @@ class TestCenter(trafficgen.ITrafficGenerator): csvreader = csv.DictReader(csvfile) for row in csvreader: self._logger.info("Row: %s", row) - result[ResultsConstants.TX_RATE_FPS] = 0.0 - result[ResultsConstants.THROUGHPUT_RX_FPS] = 0.0 - result[ResultsConstants.TX_RATE_MBPS] = 0.0 - result[ResultsConstants.THROUGHPUT_RX_MBPS] = 0.0 + tx_fps = ((float(row["TxFrameCount"])) / + (float(row["Duration(sec)"]))) + rx_fps = ((float(row["RxFrameCount"])) / + (float(row["Duration(sec)"]))) + tx_mbps = ((float(row["TxFrameCount"]) * + float(row["ConfiguredFrameSize"])) / + (float(row["Duration(sec)"]) * 1000000.0)) + rx_mbps = ((float(row["RxFrameCount"]) * + float(row["ConfiguredFrameSize"])) / + (float(row["Duration(sec)"]) * 1000000.0)) + result[ResultsConstants.TX_RATE_FPS] = tx_fps + result[ResultsConstants.THROUGHPUT_RX_FPS] = rx_fps + result[ResultsConstants.TX_RATE_MBPS] = tx_mbps + result[ResultsConstants.THROUGHPUT_RX_MBPS] = rx_mbps result[ResultsConstants.TX_RATE_PERCENT] = float( row["OfferedLoad(%)"]) result[ResultsConstants.THROUGHPUT_RX_PERCENT] = float( @@ -260,10 +270,20 @@ class TestCenter(trafficgen.ITrafficGenerator): csvreader = csv.DictReader(csvfile) for row in csvreader: self._logger.info("Row: %s", row) - result[ResultsConstants.TX_RATE_FPS] = 0.0 - result[ResultsConstants.THROUGHPUT_RX_FPS] = 0.0 - result[ResultsConstants.TX_RATE_MBPS] = 0.0 - result[ResultsConstants.THROUGHPUT_RX_MBPS] = 0.0 + tx_fps = ((float(row["TxFrameCount"])) / + (float(row["Duration(sec)"]))) + rx_fps = ((float(row["RxFrameCount"])) / + (float(row["Duration(sec)"]))) + tx_mbps = ((float(row["TxFrameCount"]) * + float(row["ConfiguredFrameSize"])) / + (float(row["Duration(sec)"]) * 1000000.0)) + rx_mbps = ((float(row["RxFrameCount"]) * + float(row["ConfiguredFrameSize"])) / + (float(row["Duration(sec)"]) * 1000000.0)) + result[ResultsConstants.TX_RATE_FPS] = tx_fps + result[ResultsConstants.THROUGHPUT_RX_FPS] = rx_fps + result[ResultsConstants.TX_RATE_MBPS] = tx_mbps + result[ResultsConstants.THROUGHPUT_RX_MBPS] = rx_mbps result[ResultsConstants.TX_RATE_PERCENT] = float( row["OfferedLoad(%)"]) result[ResultsConstants.THROUGHPUT_RX_PERCENT] = float( -- cgit 1.2.3-korg