aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsridharkn <sridhar.rao@spirent.com>2016-05-04 13:11:58 +0530
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-05-04 14:51:23 +0000
commit22ffe5b07adeb514572dc3db8b435ef4107e348b (patch)
treea547e5021a561186022b9d9f8435f0cb8e04720f
parent89864cbc856cd5cf3369429d64465615097be604 (diff)
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 <sridhar.rao@spirent.com>
-rw-r--r--tools/pkt_gen/testcenter/testcenter.py36
1 files changed, 28 insertions, 8 deletions
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(