summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/client
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/client')
-rw-r--r--scripts/automation/trex_control_plane/client/trex_async_client.py14
-rw-r--r--scripts/automation/trex_control_plane/client/trex_port.py5
2 files changed, 4 insertions, 15 deletions
diff --git a/scripts/automation/trex_control_plane/client/trex_async_client.py b/scripts/automation/trex_control_plane/client/trex_async_client.py
index 459d6915..66e65a32 100644
--- a/scripts/automation/trex_control_plane/client/trex_async_client.py
+++ b/scripts/automation/trex_control_plane/client/trex_async_client.py
@@ -28,16 +28,6 @@ class CTRexAsyncStats(object):
self.current = {}
self.last_update_ts = datetime.datetime.now()
- @staticmethod
- def format_num (size, suffix = ""):
-
- for unit in ['','K','M','G','T','P']:
- if abs(size) < 1000.0:
- return "%3.2f %s%s" % (size, unit, suffix)
- size /= 1000.0
-
- return "NaN"
-
def update (self, snapshot):
#update
@@ -60,7 +50,7 @@ class CTRexAsyncStats(object):
if not format:
return self.current[field]
else:
- return self.format_num(self.current[field], suffix)
+ return format_num(self.current[field], suffix)
def get_rel (self, field, format=False, suffix=""):
if not field in self.current:
@@ -69,7 +59,7 @@ class CTRexAsyncStats(object):
if not format:
return (self.current[field] - self.ref_point[field])
else:
- return self.format_num(self.current[field] - self.ref_point[field], suffix)
+ return format_num(self.current[field] - self.ref_point[field], suffix)
# return true if new data has arrived in the past 2 seconds
diff --git a/scripts/automation/trex_control_plane/client/trex_port.py b/scripts/automation/trex_control_plane/client/trex_port.py
index fc63cf0d..66d87f9d 100644
--- a/scripts/automation/trex_control_plane/client/trex_port.py
+++ b/scripts/automation/trex_control_plane/client/trex_port.py
@@ -403,12 +403,11 @@ class Port(object):
################# stats handler ######################
def generate_port_stats(self):
return self.port_stats.generate_stats()
- pass
def generate_port_status(self):
- return {"port-type": self.driver,
+ return {"type": self.driver,
"maximum": "{speed} Gb/s".format(speed=self.speed),
- "port-status": self.get_port_state_name()
+ "status": self.get_port_state_name()
}
def clear_stats(self):