a minor fix
authorimarom <[email protected]>
Thu, 10 Mar 2016 15:29:23 +0000 (17:29 +0200)
committerimarom <[email protected]>
Thu, 10 Mar 2016 15:29:23 +0000 (17:29 +0200)
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py

index 8d083b8..bb87758 100644 (file)
@@ -895,7 +895,10 @@ class CRxStats(CTRexStats):
         pg_current['rx_pps'] = self.calc_pps(prev_rx_pps, now_rx_pkts, prev_rx_pkts, diff_sec)
         pg_current['rx_bps'] = self.calc_bps(prev_rx_bps, now_rx_bytes, prev_rx_bytes, diff_sec)
 
-        pg_current['tx_bps_L1'] = calc_bps_L1(pg_current['tx_bps'], pg_current['tx_pps'])
+        if pg_current['tx_bps'] != None and pg_current['tx_pps'] != None:
+            pg_current['tx_bps_L1'] = calc_bps_L1(pg_current['tx_bps'], pg_current['tx_pps'])
+        else:
+            pg_current['tx_bps_L1'] = None
 
 
     def calc_pps (self, prev_bw, now, prev, diff_sec):