summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/console/trex_tui.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-05-23 18:38:22 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-05-23 18:38:22 +0300
commit9849050dd53ebf675fc9a701fea5089381eccb70 (patch)
tree2e3da57f048bf20fc5dd20759c26f9f616a3ac68 /scripts/automation/trex_control_plane/stl/console/trex_tui.py
parent4645530255fed51164b555f87d9cd1abcf7184b9 (diff)
tui: add histogram
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/console/trex_tui.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/console/trex_tui.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/console/trex_tui.py b/scripts/automation/trex_control_plane/stl/console/trex_tui.py
index 95dc654b..d3be4435 100644
--- a/scripts/automation/trex_control_plane/stl/console/trex_tui.py
+++ b/scripts/automation/trex_control_plane/stl/console/trex_tui.py
@@ -210,10 +210,15 @@ class TrexTUILatencyStats(TrexTUIPanel):
super(TrexTUILatencyStats, self).__init__(mng, "lstats")
self.key_actions = OrderedDict()
self.key_actions['c'] = {'action': self.action_clear, 'legend': 'clear', 'show': True}
+ self.key_actions['t'] = {'action': self.action_toggle_histogram, 'legend': 'toggle histogram', 'show': True}
+ self.is_histogram = False
def show (self):
- stats = self.stateless_client._get_formatted_stats(port_id_list = None, stats_mask = trex_stl_stats.LS_COMPAT)
+ if self.is_histogram:
+ stats = self.stateless_client._get_formatted_stats(port_id_list = None, stats_mask = trex_stl_stats.LH_COMPAT)
+ else:
+ stats = self.stateless_client._get_formatted_stats(port_id_list = None, stats_mask = trex_stl_stats.LS_COMPAT)
# print stats to screen
for stat_type, stat_data in stats.items():
if stat_type == 'latency_statistics':
@@ -225,6 +230,10 @@ class TrexTUILatencyStats(TrexTUIPanel):
def get_key_actions (self):
return self.key_actions
+ def action_toggle_histogram (self):
+ self.is_histogram = not self.is_histogram
+ return ""
+
def action_clear (self):
self.stateless_client.latency_stats.clear_stats()
return ""