Skip to content

Commit

Permalink
change the format (sonic-net#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
sihuihan88 authored May 13, 2017
1 parent 3378ef8 commit 7241394
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scripts/portstat
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,20 @@ class Portstat(object):
for key, data in cnstat_dict.iteritems():
if key == 'time':
continue
table.append((key, self.get_port_status(key),
data.rx_ok, "N/A", "N/A", "N/A", data.rx_err,
data.rx_drop, data.rx_ovr,
data.tx_ok, "N/A", "N/A", "N/A", data.tx_err,
data.tx_drop, data.tx_ovr))

if print_all:
table.append((key, self.get_port_status(key),
data.rx_ok, "N/A", "N/A", "N/A", data.rx_err,
data.rx_drop, data.rx_ovr,
data.tx_ok, "N/A", "N/A", "N/A", data.tx_err,
data.tx_drop, data.tx_ovr))
else:
table.append((key, self.get_port_status(key),
data.rx_ok, "N/A", "N/A", data.rx_err,
data.rx_drop, data.rx_ovr,
data.tx_ok, "N/A", "N/A", data.tx_err,
data.tx_drop, data.tx_ovr))


if use_json:
print self.table_as_json(table, print_all)
Expand Down

0 comments on commit 7241394

Please sign in to comment.