|
35 | 35 | header_std = ['IFACE', 'STATE', 'RX_OK', 'RX_BPS', 'RX_UTIL', 'RX_ERR', 'RX_DRP', 'RX_OVR', |
36 | 36 | 'TX_OK', 'TX_BPS', 'TX_UTIL', 'TX_ERR', 'TX_DRP', 'TX_OVR'] |
37 | 37 | header_errors_only = ['IFACE', 'STATE', 'RX_ERR', 'RX_DRP', 'RX_OVR', 'TX_ERR', 'TX_DRP', 'TX_OVR'] |
38 | | -header_fec_only = ['IFACE', 'STATE', 'FEC_CORR', 'FEC_UNCORR', 'FEC_SYMBOL_ERR', 'FEC_PRE_BER', 'FEC_POST_BER'] |
| 38 | +header_fec_only = ['IFACE', 'STATE', 'FEC_CORR', 'FEC_UNCORR', 'FEC_SYMBOL_ERR', 'FEC_PRE_BER', |
| 39 | + 'FEC_POST_BER', 'FEC_PRE_BER_MAX'] |
39 | 40 | header_rates_only = ['IFACE', 'STATE', 'RX_OK', 'RX_BPS', 'RX_PPS', 'RX_UTIL', 'TX_OK', 'TX_BPS', 'TX_PPS', 'TX_UTIL'] |
40 | 41 | header_trim_only = ['IFACE', 'STATE', 'TRIM_PKTS', 'TRIM_TX_PKTS', 'TRIM_DRP_PKTS'] |
41 | 42 |
|
42 | | -rates_key_list = ['RX_BPS', 'RX_PPS', 'RX_UTIL', 'TX_BPS', 'TX_PPS', 'TX_UTIL', 'FEC_PRE_BER', 'FEC_POST_BER'] |
43 | | -ratestat_fields = ("rx_bps", "rx_pps", "rx_util", "tx_bps", "tx_pps", "tx_util", "fec_pre_ber", "fec_post_ber") |
| 43 | +rates_key_list = ['RX_BPS', 'RX_PPS', 'RX_UTIL', 'TX_BPS', 'TX_PPS', 'TX_UTIL', 'FEC_PRE_BER', |
| 44 | + 'FEC_POST_BER', 'FEC_PRE_BER_MAX'] |
| 45 | +ratestat_fields = ("rx_bps", "rx_pps", "rx_util", "tx_bps", "tx_pps", "tx_util", "fec_pre_ber", "fec_post_ber", |
| 46 | + "fec_pre_ber_max") |
44 | 47 | RateStats = namedtuple("RateStats", ratestat_fields) |
45 | 48 |
|
46 | 49 | """ |
@@ -244,11 +247,12 @@ def collect_stat_from_lc(self): |
244 | 247 | tx_ovr = self.db.get(self.db.CHASSIS_STATE_DB, key, "tx_ovr") |
245 | 248 | fec_pre_ber = self.db.get(self.db.CHASSIS_STATE_DB, key, "fec_pre_ber") |
246 | 249 | fec_post_ber = self.db.get(self.db.CHASSIS_STATE_DB, key, "fec_post_ber") |
| 250 | + fec_pre_ber_max = self.db.get(self.db.CHASSIS_STATE_DB, key, "fec_pre_ber_max") |
247 | 251 | port_alias = key.split("|")[-1] |
248 | 252 | cnstat_dict[port_alias] = NStats._make([rx_ok, rx_err, rx_drop, rx_ovr, tx_ok, tx_err, tx_drop, tx_ovr] + |
249 | 253 | [STATUS_NA] * (len(NStats._fields) - 8))._asdict() |
250 | 254 | ratestat_dict[port_alias] = RateStats._make([rx_bps, rx_pps, rx_util, tx_bps, |
251 | | - tx_pps, tx_util, fec_pre_ber, fec_post_ber]) |
| 255 | + tx_pps, tx_util, fec_pre_ber, fec_post_ber, fec_pre_ber_max]) |
252 | 256 | self.cnstat_dict.update(cnstat_dict) |
253 | 257 | self.ratestat_dict.update(ratestat_dict) |
254 | 258 |
|
@@ -329,7 +333,7 @@ def get_rates(table_id): |
329 | 333 | """ |
330 | 334 | Get the rates from specific table. |
331 | 335 | """ |
332 | | - fields = ["0", "0", "0", "0", "0", "0", "0", "0"] |
| 336 | + fields = ["0", "0", "0", "0", "0", "0", "0", "0", "0"] |
333 | 337 | for pos, name in enumerate(rates_key_list): |
334 | 338 | full_table_id = RATES_TABLE_PREFIX + table_id |
335 | 339 | counter_data = self.db.get(self.db.COUNTERS_DB, full_table_id, name) |
@@ -632,7 +636,8 @@ def cnstat_diff_print(self, cnstat_new_dict, cnstat_old_dict, |
632 | 636 | ns_diff(cntr['fec_uncorr'], old_cntr['fec_uncorr']), |
633 | 637 | ns_diff(cntr['fec_symbol_err'], old_cntr['fec_symbol_err']), |
634 | 638 | format_fec_ber(rates.fec_pre_ber), |
635 | | - format_fec_ber(rates.fec_post_ber))) |
| 639 | + format_fec_ber(rates.fec_post_ber), |
| 640 | + format_fec_ber(rates.fec_pre_ber_max))) |
636 | 641 | elif rates_only: |
637 | 642 | header = header_rates_only |
638 | 643 |
|
|
0 commit comments