diff options
author | imarom <imarom@cisco.com> | 2016-04-12 18:01:43 +0300 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-04-12 18:02:08 +0300 |
commit | 87bac1abebe2f5a853e32301a68b9f6adf97de99 (patch) | |
tree | da9d169f819cdddb0e6c4ed9aa09d3051ef7227e /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | |
parent | 2c00ae277f8c50ebeec17f0e059b17f2b4ba2a07 (diff) |
added checks for warnings on examples
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 48111433..dea7c6d5 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 @@ -105,6 +105,9 @@ class WatchedField(object): self.current = None def update (self, value): + if value is None: + return + if value > self.high_th and not self.hot: self.events_handler.log_warning("{0} is high: {1}{2}".format(self.name, value, self.suffix)) self.hot = True @@ -607,8 +610,8 @@ class CGlobalStats(CTRexStats): # simple... self.latest_stats = snapshot - self.watched_cpu_util.update(snapshot['m_cpu_util']) - self.watched_rx_cpu_util.update(snapshot['m_rx_cpu_util']) + self.watched_cpu_util.update(snapshot.get('m_cpu_util')) + self.watched_rx_cpu_util.update(snapshot.get('m_rx_cpu_util')) return True |