summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/common
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-12-14 04:47:35 -0500
committerimarom <imarom@cisco.com>2015-12-14 04:48:15 -0500
commitbae48d6cf8dd59158ffcb488391af8a96fc2e037 (patch)
treeff85ec461453c6a3a6bee5c080dd67b61990eca2 /scripts/automation/trex_control_plane/common
parentca565fd24f0336d704410d69fe67b70405f2a38c (diff)
TUI v2.0 - now no flickering, state machine for lost of connectivity
and TUI can be started in xterm using tui -x
Diffstat (limited to 'scripts/automation/trex_control_plane/common')
-rwxr-xr-xscripts/automation/trex_control_plane/common/trex_stats.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/common/trex_stats.py b/scripts/automation/trex_control_plane/common/trex_stats.py
index 2f6ea38d..20255f41 100755
--- a/scripts/automation/trex_control_plane/common/trex_stats.py
+++ b/scripts/automation/trex_control_plane/common/trex_stats.py
@@ -194,6 +194,9 @@ class CTRexStats(object):
@staticmethod
def format_num(size, suffix = ""):
+ if type(size) == str:
+ return "N/A"
+
for unit in ['','K','M','G','T','P']:
if abs(size) < 1000.0:
return "%3.2f %s%s" % (size, unit, suffix)
@@ -219,6 +222,9 @@ class CTRexStats(object):
def clear_stats(self):
self.reference_stats = self.latest_stats
+ def invalidate (self):
+ self.latest_stats = {}
+
def get(self, field, format=False, suffix=""):
if not field in self.latest_stats:
return "N/A"