summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/common
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/common')
-rwxr-xr-xscripts/automation/trex_control_plane/common/trex_stats.py4
-rw-r--r--scripts/automation/trex_control_plane/common/trex_types.py6
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: