From b726b5682fca2b1e032380401457d1afb47e1713 Mon Sep 17 00:00:00 2001 From: imarom Date: Wed, 20 Jan 2016 11:09:25 -0500 Subject: draft #3 --- scripts/automation/trex_control_plane/common/trex_stats.py | 4 ++++ scripts/automation/trex_control_plane/common/trex_types.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts/automation/trex_control_plane/common') 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: -- cgit 1.2.3-korg