aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen/moongen
diff options
context:
space:
mode:
authorbmichalo <bmichalo@redhat.com>2016-07-29 10:10:00 -0400
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-08-08 09:22:18 +0100
commitda059df422c839bb5d6393455a43c44e95873c73 (patch)
tree05cd4bb2dcdd0d91852b7de80ed0d279381f5275 /tools/pkt_gen/moongen
parentb219f67de8e314e419108d9e15667c2cd2b973d1 (diff)
pkt_gen: MoonGen incorrectly calculates rx/tx % statistics
For MoonGen, the final results parameters: throughput_rx_percent, throughput_tx_percent were incorrectly calculated when converting MoonGen to VSPERF format. In particular, this would occur when more than one data stream (single channel unidirectional traffic) was used in the test. When calculating these percentages, only aggregate throughput values equaling unidirectional traffic were used (for example, for 64 byte frames bidirectional traffic should use 29.76 Mpps, not 14.88 Mpps) JIRA: VSPERF-341 Change-Id: Ie62bded7aea023c287697f18c4172b58c320e050 Signed-off-by: bmichalo <bmichalo@redhat.com>
Diffstat (limited to 'tools/pkt_gen/moongen')
-rw-r--r--tools/pkt_gen/moongen/moongen.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/pkt_gen/moongen/moongen.py b/tools/pkt_gen/moongen/moongen.py
index e14c6a79..1d2fdee5 100644
--- a/tools/pkt_gen/moongen/moongen.py
+++ b/tools/pkt_gen/moongen/moongen.py
@@ -488,10 +488,21 @@ class Moongen(ITrafficGenerator):
'PARAMETERS section of Moongen log file')
frame_size = 0
- if results_match and parameters_match:
+ # Each packet stream in the MoonGen report is prefaced with the
+ # words '[REPORT]Device'. Count the instances of this string to
+ # get the total aggregrate throughput. For example:
+ #
+ # - If num_traffic_streams = 1, there is a single
+ # unidirectional stream
+ #
+ # - If num_traffic_streams = 2, there is a bidirectional
+ # traffic stream
+ num_traffic_streams = mytext.count('[REPORT]Device')
+
+ if results_match and parameters_match and num_traffic_streams:
# Assume for now 10G link speed
- max_theoretical_mfps = (
- (self._moongen_line_speed / 8) / (frame_size + 20))
+ max_theoretical_fps = (
+ num_traffic_streams * (10000000000 / 8) / (frame_size + 20))
moongen_results[ResultsConstants.THROUGHPUT_RX_FPS] = (
float(results_match.group(6)) * 1000000)
@@ -500,8 +511,7 @@ class Moongen(ITrafficGenerator):
(float(results_match.group(6)) * frame_size + 20) * 8)
moongen_results[ResultsConstants.THROUGHPUT_RX_PERCENT] = (
- float(results_match.group(6)) * \
- 1000000 / max_theoretical_mfps * 100)
+ (100 * float(results_match.group(6)) * 1000000) / max_theoretical_fps)
moongen_results[ResultsConstants.TX_RATE_FPS] = (
float(results_match.group(5)) * 1000000)
@@ -510,8 +520,7 @@ class Moongen(ITrafficGenerator):
float(results_match.group(5)) * (frame_size + 20) * 8)
moongen_results[ResultsConstants.TX_RATE_PERCENT] = (
- float(results_match.group(5)) *
- 1000000 / max_theoretical_mfps * 100)
+ (100 * float(results_match.group(5)) * 1000000) / max_theoretical_fps)
moongen_results[ResultsConstants.B2B_TX_COUNT] = (
float(results_match.group(1)))