aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/traffic_profile
diff options
context:
space:
mode:
authortreyad <treyad@viosoft.com>2019-02-12 12:23:00 -0800
committertreyad <treyad@viosoft.com>2019-02-12 12:23:00 -0800
commitec8bf118c4b9e1b31392530a82022d7c5210cd5a (patch)
tree8d8207739396c69c21c124240a181bae7db97be4 /yardstick/network_services/traffic_profile
parent0dbd3bb46b6d2aaa71c6bf2be046c3c0f877466b (diff)
Generate correct IMIX distribution for STL profile
JIRA: YARDSTICK-1599 Change-Id: I654644d7944d0af41d8da12cc002f31fcfecf62e Signed-off-by: treyad <treyad@viosoft.com>
Diffstat (limited to 'yardstick/network_services/traffic_profile')
-rw-r--r--yardstick/network_services/traffic_profile/rfc2544.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/yardstick/network_services/traffic_profile/rfc2544.py b/yardstick/network_services/traffic_profile/rfc2544.py
index b838bf814..1fe229769 100644
--- a/yardstick/network_services/traffic_profile/rfc2544.py
+++ b/yardstick/network_services/traffic_profile/rfc2544.py
@@ -142,7 +142,7 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile):
return trex_stl_streams.STLProfile(streams)
def _create_imix_data(self, imix,
- weight_mode=constants.DISTRIBUTION_IN_PACKETS):
+ weight_mode=constants.DISTRIBUTION_IN_BYTES):
"""Generate the IMIX distribution for a STL profile
The input information is the framesize dictionary in a test case
@@ -192,13 +192,13 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile):
imix_dip = {size: float(weight) / weight_normalize
for size, weight in imix_count.items()}
- if weight_mode == constants.DISTRIBUTION_IN_BYTES:
+ if weight_mode == constants.DISTRIBUTION_IN_PACKETS:
return imix_dip
byte_total = sum([int(size) * weight
- for size, weight in imix_dip.items()])
- return {size: (int(size) * weight * 100) / byte_total
- for size, weight in imix_dip.items()}
+ for size, weight in imix_count.items()])
+ return {size: float(int(size) * weight * 100) / byte_total
+ for size, weight in imix_count.items()}
def _create_vm(self, packet_definition):
"""Create the STL Raw instructions"""