- result["total_tx_rate"] = total_tx_pkts / self.config.duration_sec
- return result
-
- def __combine_stats(self, in_stats, port_handle):
- """Traverses TRex result dictionary and combines stream stats. Used for combining latency
- and regular streams together.
- """
- result = defaultdict(lambda: defaultdict(float))
-
- for pg_id in [self.stream_ids[port_handle]] + self.latencies[port_handle]:
- record = in_stats['flow_stats'][pg_id]
- for stat_type, stat_type_values in record.iteritems():
- for ph, value in stat_type_values.iteritems():
- result[stat_type][ph] += value
-