diff options
author | imarom <imarom@cisco.com> | 2016-01-20 11:09:25 -0500 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-01-21 10:11:56 -0500 |
commit | b726b5682fca2b1e032380401457d1afb47e1713 (patch) | |
tree | b56576cd385cc662453095917d8c6d87ff4e62c8 /scripts/automation/trex_control_plane/common | |
parent | c93acc26bf2517c872da716198e76bcf566b836a (diff) |
draft #3
Diffstat (limited to 'scripts/automation/trex_control_plane/common')
-rwxr-xr-x | scripts/automation/trex_control_plane/common/trex_stats.py | 4 | ||||
-rw-r--r-- | scripts/automation/trex_control_plane/common/trex_types.py | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/common/trex_stats.py b/scripts/automation/trex_control_plane/common/trex_stats.py index a6add4ac..3d6ece7c 100755 --- a/scripts/automation/trex_control_plane/common/trex_stats.py +++ b/scripts/automation/trex_control_plane/common/trex_stats.py @@ -314,6 +314,10 @@ class CTRexStats(object): self.last_update_ts = time.time() + def get_stats (self): + # copy and return + return dict(self.latest_stats) + def clear_stats(self): self.reference_stats = self.latest_stats diff --git a/scripts/automation/trex_control_plane/common/trex_types.py b/scripts/automation/trex_control_plane/common/trex_types.py index aada5bfc..a7ddacea 100644 --- a/scripts/automation/trex_control_plane/common/trex_types.py +++ b/scripts/automation/trex_control_plane/common/trex_types.py @@ -46,7 +46,11 @@ class RC(): return (e if len(e) != 1 else e[0]) def __str__ (self): - return str(self.data()) if self else str(self.err()) + s = "" + for x in self.rc_list: + if x.data: + s += format_text("\n{0}".format(x.data), 'bold') + return s def prn_func (self, msg, newline = True): if newline: |