diff options
author | Ido Barnea <ibarnea@cisco.com> | 2016-03-07 10:55:59 +0200 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2016-03-07 10:55:59 +0200 |
commit | ca3f7e0f81f782638440353c456382b6e607c71e (patch) | |
tree | 8cd21cd54a2e1d55bae1799cc95315d498f0cddd /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | |
parent | d5047a7e044c681fffa436015fd9cd246e4ad1b2 (diff) |
changed rx stats to flow stats everywhere
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | 36 |
1 files changed, 18 insertions, 18 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 eca7fd7a..c2e318bc 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 @@ -131,10 +131,10 @@ class CTRexInfoGenerator(object): ("ipackets", []), ("obytes", []), ("ibytes", []), - ("tx-bytes", []), - ("rx-bytes", []), - ("tx-pkts", []), - ("rx-pkts", []), + ("tx_bytes", []), + ("rx_bytes", []), + ("tx_pkts", []), + ("rx_pkts", []), ("-----", []), ("oerrors", []), @@ -627,10 +627,10 @@ class CPortStats(CTRexStats): "obytes" : self.get_rel("obytes"), "ibytes" : self.get_rel("ibytes"), - "tx-bytes": self.get_rel("obytes", format = True, suffix = "B"), - "rx-bytes": self.get_rel("ibytes", format = True, suffix = "B"), - "tx-pkts": self.get_rel("opackets", format = True, suffix = "pkts"), - "rx-pkts": self.get_rel("ipackets", format = True, suffix = "pkts"), + "tx_bytes": self.get_rel("obytes", format = True, suffix = "B"), + "rx_bytes": self.get_rel("ibytes", format = True, suffix = "B"), + "tx_pkts": self.get_rel("opackets", format = True, suffix = "pkts"), + "rx_pkts": self.get_rel("ipackets", format = True, suffix = "pkts"), "oerrors" : format_num(self.get_rel("oerrors"), compact = False, @@ -645,28 +645,28 @@ class CPortStats(CTRexStats): class CRxStats(object): def __init__(self): - self.rx_stats = {} + self.flow_stats = {} def update (self, snapshot): - self.rx_stats = snapshot + self.flow_stats = snapshot def get_stats (self): stats = {} - for user_id, user_id_data in self.rx_stats.iteritems(): - # ignore non user ID keys + for pg_id, pg_id_data in self.flow_stats.iteritems(): + # ignore non pg ID keys try: - user_id = int(user_id) + pg_id = int(pg_id) except ValueError: continue - # handle user id - stats[user_id] = {} - for field, per_port_data in user_id_data.iteritems(): - stats[user_id][field] = {} + # handle pg id + stats[pg_id] = {} + for field, per_port_data in pg_id_data.iteritems(): + stats[pg_id][field] = {} for port, value in per_port_data.iteritems(): - stats[user_id][field][int(port)] = value + stats[pg_id][field][int(port)] = value return stats |