diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-05-10 17:49:25 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-05-10 17:49:25 +0300 |
commit | 2d37b9f98020a4458aaad1f3fd05ca5e408213e0 (patch) | |
tree | 3a8cd16eb748711b72df37c6f7eea4842d73290a /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | |
parent | 996f2451dba01f534420418eaac2856510682757 (diff) | |
parent | 63bf6aba10075a03fe6609369c1c7008afb85ba7 (diff) |
merge from master
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py index c7513144..61122e79 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py @@ -28,6 +28,9 @@ SS_COMPAT = [GLOBAL_STATS, STREAMS_STATS] ExportableStats = namedtuple('ExportableStats', ['raw_data', 'text_table']) +def round_float (f): + return float("%.2f" % f) + # deep mrege of dicts dst = src + dst def deep_merge_dicts (dst, src): for k, v in src.items(): @@ -633,10 +636,10 @@ class CGlobalStats(CTRexStats): ("version", "{ver}, UUID: {uuid}".format(ver=self.server_version.get("version", "N/A"), uuid="N/A")), - ("cpu_util", "{0}% {1}".format( format_threshold(self.get("m_cpu_util"), [85, 100], [0, 85]), + ("cpu_util", "{0}% {1}".format( format_threshold(round_float(self.get("m_cpu_util")), [85, 100], [0, 85]), self.get_trend_gui("m_cpu_util", use_raw = True))), - ("rx_cpu_util", "{0}% {1}".format( format_threshold(self.get("m_rx_cpu_util"), [85, 100], [0, 85]), + ("rx_cpu_util", "{0}% {1}".format( format_threshold(round_float(self.get("m_rx_cpu_util")), [85, 100], [0, 85]), self.get_trend_gui("m_rx_cpu_util", use_raw = True))), (" ", ""), |