sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

portstat overflow: Convert to float first from exponent notation before input to int()

Open rraghav-cisco opened this issue 1 year ago • 5 comments

fixes sonic-net/sonic-buildimage#20407,

What I did

Typecast the exponential notation to float before being input to int() function.

How to verify it

  1. Run traffic on any dataport so that the counters exceed 10^14.
  2. After that run the sonic commands that use use portstat.

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

Traceback was seen, as shown in sonic-net/sonic-buildimage#20407 .

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

It prints the output correctly:

root@yy39top-lc4:/home/cisco# show int count
      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        U  1,405,887,650,456  38113.57 MB/s     76.23%         0               13         0    4,841  2247.54 KB/s      0.00%         0         3         0
  Ethernet8        X                  0       0.00 B/s      0.00%         0                0         0        0      0.00 B/s      0.00%         0         0         0

rraghav-cisco avatar Jul 13 '24 05:07 rraghav-cisco

Hi @abdosi , @cyw233 , please review.

anamehra avatar Sep 27 '24 00:09 anamehra

adding @auspham for viz

cyw233 avatar Sep 27 '24 01:09 cyw233

Hi @rraghav-cisco this is the same fix as https://github.com/sonic-net/sonic-utilities/pull/3538/files where @qiluo-msft suspect that this issue happened before. I suspect it happened already while converting counter from SAI apis

auspham avatar Sep 27 '24 01:09 auspham

Hi @rraghav-cisco this is the same fix as https://github.com/sonic-net/sonic-utilities/pull/3538/files where @qiluo-msft suspect that this issue happened before. I suspect it happened already while converting counter from SAI apis

@auspham : Pls close either one of them, as needed.

rraghav-cisco avatar Oct 01 '24 22:10 rraghav-cisco

@rraghav-cisco, this will only fix the show utilities command, the scientific notation however will still be there in the database which will be a problem for other components.

I have updated cisco jira ticket to look into this

Hi @yejianquan, could you please help reviewing this change from CISCO and if we can merge it in to unblock this testcase?

auspham avatar Oct 02 '24 01:10 auspham

@auspham please resolve the conflicts

arlakshm avatar Nov 13 '24 18:11 arlakshm

This PR can be closed. Issue is fixed by https://github.com/sonic-net/sonic-utilities/pull/3596

anamehra avatar Nov 13 '24 18:11 anamehra

Handled and completed in another PR: https://github.com/sonic-net/sonic-utilities/pull/3596 Closing this PR.

rraghav-cisco avatar Nov 13 '24 18:11 rraghav-cisco