Skip to content

[portstat] show BPS, PPS, UTIL rates (based on speed) w/o previous clear#702

Closed
mykolaf wants to merge 1 commit intosonic-net:201811from
mykolaf:portstat11
Closed

[portstat] show BPS, PPS, UTIL rates (based on speed) w/o previous clear#702
mykolaf wants to merge 1 commit intosonic-net:201811from
mykolaf:portstat11

Conversation

@mykolaf
Copy link
Collaborator

@mykolaf mykolaf commented Oct 11, 2019

Signed-off-by: Mykola Faryma [email protected]

- What I did
Backported changes from #508 and #563 .
Now packet and byte rates and correct(based on speed) utilization is available on CLI without the need to perform clear of counters.
- How I did it

- How to verify it

   show int counter -h
   show int counter -a
   show int counter -p 20
   portstat -j
   portstat -j -p5

- Previous command output (if the output of a command-line utility has changed)
Notice the N/A

root@sonic:/home/admin# show in co | head
      IFACE    STATE    RX_OK    RX_BPS    RX_UTIL    RX_ERR    RX_DRP    RX_OVR    TX_OK    TX_BPS    TX_UTIL    TX_ERR    TX_DRP    TX_OVR
-----------  -------  -------  --------  ---------  --------  --------  --------  -------  --------  ---------  --------  --------  --------
  Ethernet0        X        0       N/A        N/A         0         0       N/A        0       N/A        N/A         0         0       N/A
  Ethernet4        U        0       N/A        N/A         0         0       N/A      252       N/A        N/A         0         0       N/A
  Ethernet8        U        0       N/A        N/A         0         0       N/A      253       N/A        N/A         0         0       N/A
 Ethernet12        U        0       N/A        N/A         0         0       N/A      251       N/A        N/A         0         0       N/A
 Ethernet16        U        0       N/A        N/A         0         0       N/A      251       N/A        N/A         0         0       N/A
 Ethernet20        U        0       N/A        N/A         0         0       N/A      251       N/A        N/A         0         0       N/A
 Ethernet24        U        0       N/A        N/A         0         0       N/A      251       N/A        N/A         0         0       N/A
 Ethernet28        U        0       N/A        N/A         0         0       N/A      251       N/A        N/A         0         0       N/A

- New command output (if the output of a command-line utility has changed)

root@sonic:/tmp# show int counter | head
     IFACE    STATE    RX_OK      RX_BPS    RX_UTIL    RX_ERR    RX_DRP    RX_OVR    TX_OK      TX_BPS    TX_UTIL    TX_ERR    TX_DRP    TX_OVR
----------  -------  -------  ----------  ---------  --------  --------  --------  -------  ----------  ---------  --------  --------  --------
 Ethernet0        X        0    0.00 B/s      0.00%         0         0       N/A        0    0.00 B/s      0.00%         0         0       N/A
 Ethernet1        U      324    1.52 B/s      0.00%         0         0       N/A    1,213    7.69 B/s      0.00%         0         0       N/A
 Ethernet2        U      504    2.39 B/s      0.00%         0         0       N/A    1,213    7.69 B/s      0.00%         0         0       N/A
 Ethernet3        U      396    1.86 B/s      0.00%         0         0       N/A    1,213    7.69 B/s      0.00%         0         0       N/A
 Ethernet4        U      252    1.21 B/s      0.00%         0         0       N/A    1,213    7.69 B/s      0.00%         0         0       N/A
 Ethernet5        U      342    1.62 B/s      0.00%         0         0       N/A    1,212    7.69 B/s      0.00%         0         0       N/A
 Ethernet6        U      288    1.39 B/s      0.00%         0         0       N/A    1,213    7.69 B/s      0.00%         0         0       N/A
 Ethernet7        U      342    1.60 B/s      0.00%         0         0       N/A    1,212    7.69 B/s      0.00%         0         0       N/A

-->

@liat-grozovik
Copy link
Collaborator

retest this please

@jleveque jleveque changed the title [portstat] show BPS, PPS, UTIL rates (based on speed) w/o previous c… [portstat] show BPS, PPS, UTIL rates (based on speed) w/o previous clear Oct 17, 2019
@lguohan
Copy link
Contributor

lguohan commented Oct 19, 2019

the label is enhancement, not bug fix.

@mykolaf

This comment has been minimized.

@liat-grozovik
Copy link
Collaborator

the only test which is falling is. @yxieca can you please take a look? maybe you have an idea why it is failing as it seems not related to this PR

Test Result (1 failure / +1) test_warm_reboot.TestWarmReboot.test_system_warmreboot_neighbor_syncup

Copy link
Contributor

@yxieca yxieca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'uptime' to calculate speed is unacceptable.

Not all platforms under all reboot types will clear counters when uptime == 0. This change is asking for high severity level warnings in production.

@yxieca
Copy link
Contributor

yxieca commented Oct 29, 2019

Also, actions like config reload, syncd cold restart, will cause counter to be cleared when uptime != 0. I don't think we should present estimate that could be wrong to the end user in cli. It is ok to calculate this way and used in a test. But that should be done in the test code.

@liat-grozovik
Copy link
Collaborator

As pointed above this solution is not acceptable. I don't see any reason to keep this code open and mistakenly used/merged this closing it.

@mykolaf mykolaf deleted the portstat11 branch February 18, 2020 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants