diff options
author | 2016-03-13 15:11:15 +0200 | |
---|---|---|
committer | 2016-03-13 15:11:15 +0200 | |
commit | cb4fc4381b85661658885c3c5f9e0bbcb1ce280a (patch) | |
tree | ec0280bfbd768111fabb81842203ffe0127ab8b6 /scripts/automation/trex_control_plane/stl/trex_stl_lib | |
parent | 7b31357d9cf8a5a930e9423508d61b5b137049bb (diff) |
RX stats API/TUI refinement
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-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 |