diff options
Diffstat (limited to 'scripts/automation/trex_control_plane/console')
-rwxr-xr-x | scripts/automation/trex_control_plane/console/trex_console.py | 4 | ||||
-rw-r--r-- | scripts/automation/trex_control_plane/console/trex_status.py | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/console/trex_console.py b/scripts/automation/trex_control_plane/console/trex_console.py index bd79cb42..549262c5 100755 --- a/scripts/automation/trex_control_plane/console/trex_console.py +++ b/scripts/automation/trex_control_plane/console/trex_console.py @@ -409,6 +409,10 @@ class TRexConsole(cmd.Cmd): def do_status (self, line): '''Shows a graphical console\n''' + if not self.stateless_client.is_connected(): + print "Not connected to server\n" + return + self.do_verbose('off') trex_status.show_trex_status(self.stateless_client) diff --git a/scripts/automation/trex_control_plane/console/trex_status.py b/scripts/automation/trex_control_plane/console/trex_status.py index 4cd07358..4e73e0bb 100644 --- a/scripts/automation/trex_control_plane/console/trex_status.py +++ b/scripts/automation/trex_control_plane/console/trex_status.py @@ -113,6 +113,10 @@ class GeneralInfoPanel(TrexStatusPanel): def draw (self): self.clear() + if not self.general_stats.is_online(): + self.getwin().addstr(3, 2, "No Published Data From TRex Server") + return + self.getwin().addstr(3, 2, "{:<30} {:0.2f} %".format("CPU util.:", self.general_stats.get("m_cpu_util"))) self.getwin().addstr(5, 2, "{:<30} {:} / {:}".format("Total Tx. rate:", @@ -366,6 +370,10 @@ class TrexStatus(): self.stdscr = stdscr self.stateless_client = stateless_client + + self.log = TrexStatusLog() + self.cmds = TrexStatusCommands(self) + self.general_stats = stateless_client.get_stats_async().get_general_stats() # fetch server info @@ -379,8 +387,7 @@ class TrexStatus(): self.owned_ports = self.stateless_client.get_acquired_ports() - self.log = TrexStatusLog() - self.cmds = TrexStatusCommands(self) + def generate_layout (self): self.max_y = self.stdscr.getmaxyx()[0] |