Skip to content

Conversation

Junchao-Mellanox
Copy link
Collaborator

What I did

When clearing stats, current flow counter stats is serialized to a file for further compare. All stats value is saved as string value. When doing diff, the loaded stats value shall be convert into int and do the compare. The PR is to fix this issue.

How I did it

  1. Convert value to int when doing compare
  2. Save value as string to the dump file

How to verify it

  1. Adjust unit test case to cover the change

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

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

@prsunny prsunny merged commit 626cdc4 into sonic-net:master Jan 11, 2022
@Junchao-Mellanox Junchao-Mellanox deleted the fix-clear-stats branch January 13, 2022 09:49
@Junchao-Mellanox
Copy link
Collaborator Author

Hi @prsunny, could you please help cherry-pick to 202111?

@Junchao-Mellanox
Copy link
Collaborator Author

Hi @judyjoseph , could you please help cherry-pick to 202111?

judyjoseph pushed a commit that referenced this pull request Jan 17, 2022
*When clearing stats, current flow counter stats is serialized to a file for further compare. All stats value is saved as string value. When doing diff, the loaded stats value shall be convert into int and do the compare. The PR is to fix this issue.
manish1-arista added a commit to manish1-arista/sonic-utilities that referenced this pull request Aug 25, 2025
* Caching the current counters when sonic-clear queuecounters is executed.
* Calculating and displaying the difference in counter values when the show command is run.
* Providing clear CLI messaging to indicate the behavior when run from supervisor(clear aggregate VOQ counters only).
* Unit test for clear aggregate VOQ counters is added verifying the data is cached and counters are cleared properly.
manish1-arista added a commit to manish1-arista/sonic-utilities that referenced this pull request Aug 25, 2025
…t#2001)

* Caching the current counters when sonic-clear queuecounters is executed.
* Calculating and displaying the difference in counter values when the show command is run.
* Providing clear CLI messaging to indicate the behavior when run from supervisor(clear aggregate VOQ counters only).
* Unit test for clear aggregate VOQ counters is added verifying the data is cached and counters are cleared properly.

Signed-off-by: manish <manish1@arista.com>
manish1-arista added a commit to manish1-arista/sonic-utilities that referenced this pull request Aug 27, 2025
…t#2001)

* Caching the current counters when sonic-clear queuecounters is executed.
* Calculating and displaying the difference in counter values when the show command is run.
* Providing clear CLI messaging to indicate the behavior when run from supervisor(clear aggregate VOQ counters only).
* Unit test for clear aggregate VOQ counters is added verifying the data is cached and counters are cleared properly.

Signed-off-by: manish <manish1@arista.com>
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.

5 participants