diff options
author | Pierrick Louin <pierrick.louin@orange.com> | 2019-08-02 15:16:33 +0200 |
---|---|---|
committer | fmenguy <francoisregis.menguy@orange.com> | 2019-12-02 14:11:00 +0100 |
commit | 24314713446b6411cedce4329ab5ebfd6da678a2 (patch) | |
tree | 8d2bdfb2a722ca6f538c5567e7197173e703efba /nfvbench/traffic_gen | |
parent | 15ecdba939f0377c0cccaa76e5a070ef2357056b (diff) |
NFVBENCH-155 Add options to disable extra stats, latency stats and latency streamsPY27_BASE3.7.0py27
Change-Id: I9af56bf1b618a072adbc92b43e65e10b274d4f17
Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
Diffstat (limited to 'nfvbench/traffic_gen')
-rw-r--r-- | nfvbench/traffic_gen/trex_gen.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/nfvbench/traffic_gen/trex_gen.py b/nfvbench/traffic_gen/trex_gen.py index b8e32e3..53786f7 100644 --- a/nfvbench/traffic_gen/trex_gen.py +++ b/nfvbench/traffic_gen/trex_gen.py @@ -438,6 +438,8 @@ class TRex(AbstractTrafficGenerator): """ streams = [] pg_id, lat_pg_id = self.get_pg_id(port, chain_id) + if self.config.no_flow_stats: + LOG.info("Traffic flow statistics are disabled.") if l2frame == 'IMIX': for ratio, l2_frame_size in zip(IMIX_RATIOS, IMIX_L2_SIZES): pkt = self._create_pkt(stream_cfg, l2_frame_size) @@ -448,11 +450,13 @@ class TRex(AbstractTrafficGenerator): if stream_cfg['vxlan'] is True: streams.append(STLStream(packet=pkt, flow_stats=STLFlowStats(pg_id=pg_id, - vxlan=True), + vxlan=True) + if not self.config.no_flow_stats else None, mode=STLTXCont(pps=ratio))) else: streams.append(STLStream(packet=pkt, - flow_stats=STLFlowStats(pg_id=pg_id), + flow_stats=STLFlowStats(pg_id=pg_id) + if not self.config.no_flow_stats else None, mode=STLTXCont(pps=ratio))) if latency: @@ -469,11 +473,13 @@ class TRex(AbstractTrafficGenerator): if stream_cfg['vxlan'] is True: streams.append(STLStream(packet=pkt, flow_stats=STLFlowStats(pg_id=pg_id, - vxlan=True), + vxlan=True) + if not self.config.no_flow_stats else None, mode=STLTXCont())) else: streams.append(STLStream(packet=pkt, - flow_stats=STLFlowStats(pg_id=pg_id), + flow_stats=STLFlowStats(pg_id=pg_id) + if not self.config.no_flow_stats else None, mode=STLTXCont())) # for the latency stream, the minimum payload is 16 bytes even in case of vlan tagging # without vlan, the min l2 frame size is 64 @@ -483,14 +489,18 @@ class TRex(AbstractTrafficGenerator): pkt = self._create_pkt(stream_cfg, 68) if latency: + if self.config.no_latency_stats: + LOG.info("Latency flow statistics are disabled.") if stream_cfg['vxlan'] is True: streams.append(STLStream(packet=pkt, flow_stats=STLFlowLatencyStats(pg_id=lat_pg_id, - vxlan=True), + vxlan=True) + if not self.config.no_latency_stats else None, mode=STLTXCont(pps=self.LATENCY_PPS))) else: streams.append(STLStream(packet=pkt, - flow_stats=STLFlowLatencyStats(pg_id=lat_pg_id), + flow_stats=STLFlowLatencyStats(pg_id=lat_pg_id) + if not self.config.no_latency_stats else None, mode=STLTXCont(pps=self.LATENCY_PPS))) return streams |