result["latency"] = in_stats["latency"]
# Merge HDRHistogram to have an overall value for all chains and ports
+ # (provided that the histogram exists in the stats returned by T-Rex)
+ # Of course, empty histograms will produce an empty (invalid) histogram.
try:
hdrh_list = []
if ifstats:
x.add(y)
return x
decoded_hdrh = reduce(add_hdrh, hdrh_list)
- result["hdrh"] = HdrHistogram.encode(decoded_hdrh).decode('utf-8')
+ result["overall_hdrh"] = HdrHistogram.encode(decoded_hdrh).decode('utf-8')
except KeyError:
pass
"""
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)
streams.append(STLStream(packet=pkt,
flow_stats=STLFlowStats(pg_id=pg_id,
vxlan=True)
- if not self.config.no_flow_stats else None,
+ 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)
- if not self.config.no_flow_stats else None,
+ if not self.config.no_flow_stats else None,
mode=STLTXCont(pps=ratio)))
if latency:
streams.append(STLStream(packet=pkt,
flow_stats=STLFlowStats(pg_id=pg_id,
vxlan=True)
- if not self.config.no_flow_stats else None,
+ if not self.config.no_flow_stats else None,
mode=STLTXCont()))
else:
streams.append(STLStream(packet=pkt,
flow_stats=STLFlowStats(pg_id=pg_id)
- if not self.config.no_flow_stats else None,
+ 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
streams.append(STLStream(packet=pkt,
flow_stats=STLFlowLatencyStats(pg_id=lat_pg_id,
vxlan=True)
- if not self.config.no_latency_stats else None,
+ 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)
- if not self.config.no_latency_stats else None,
+ if not self.config.no_latency_stats else None,
mode=STLTXCont(pps=self.LATENCY_PPS)))
return streams
latency: True if latency measurement is needed
e2e: True if performing "end to end" connectivity check
"""
+ if self.config.no_flow_stats:
+ LOG.info("Traffic flow statistics are disabled.")
r = self.__is_rate_enough(l2frame_size, rates, bidirectional, latency)
if not r['result']:
raise TrafficGeneratorException(