diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py index bb877586..12bf881a 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py @@ -828,8 +828,8 @@ class CRxStats(CTRexStats): # copy timestamp field output['ts'] = current['ts'] - # aggregate all the PG ids (previous and current) - pg_ids = filter(is_intable, set(prev.keys() + current.keys())) + # we care only about the current active keys + pg_ids = filter(is_intable, current.keys()) for pg_id in pg_ids: @@ -854,6 +854,13 @@ class CRxStats(CTRexStats): self.calculate_bw_for_pg(output[pg_id], prev_pg, diff_sec) + # cleanp old reference values - they are dead + ref_pg_ids = filter(is_intable, self.reference_stats.keys()) + + deleted_pg_ids = set(ref_pg_ids).difference(pg_ids) + for d_pg_id in deleted_pg_ids: + del self.reference_stats[d_pg_id] + return output |