-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add trap flow counter support #1868
Add trap flow counter support #1868
Conversation
a35423e
to
eb997c1
Compare
Hi @qiluo-msft , could you please suggest a reviewer from MSFT side? Thanks! |
Hi @qiluo-msft , kindly reminder, could you please suggest a reviewer? |
eb997c1
to
80035f1
Compare
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
8227476
to
d9563bf
Compare
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
d9563bf
to
298260f
Compare
298260f
to
384b1fb
Compare
/azpw run Azure.sonic-utilities |
/AzurePipelines run Azure.sonic-utilities |
Azure Pipelines successfully started running 1 pipeline(s). |
@dgsudharsan, can you review this as well? |
counterpoll/main.py
Outdated
@@ -352,6 +386,8 @@ def show(): | |||
data.append([ACL, pg_drop_info.get("POLL_INTERVAL", DEFLT_10_SEC), acl_info.get("FLEX_COUNTER_STATUS", DISABLE)]) | |||
if tunnel_info: | |||
data.append(["TUNNEL_STAT", rif_info.get("POLL_INTERVAL", DEFLT_10_SEC), rif_info.get("FLEX_COUNTER_STATUS", DISABLE)]) | |||
if trap_info: | |||
data.append(["FLOW_CNT_TRAP_STAT", trap_info.get("POLL_INTERVAL", DEFLT_1_SEC), trap_info.get("FLEX_COUNTER_STATUS", DISABLE)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be changed to 10 sec?
tests/counterpoll_test.py
Outdated
@@ -27,6 +26,7 @@ | |||
PG_WATERMARK_STAT 10000 enable | |||
PG_DROP_STAT 10000 enable | |||
ACL 10000 enable | |||
FLOW_CNT_TRAP_STAT 1000 enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be 10000?
|
||
old_values = old_stats[name] | ||
if values[-1] != old_values[-1]: | ||
# Counter OID not equal means the trap was removed and added again. Removing a trap would cause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good logic to handle. However, what if OID returned is the same as before delete? Should we rather not check if the diff is negative and consider it as a case where trap got deleted?
/azpw run Azure.sonic-utilities |
/AzurePipelines run Azure.sonic-utilities |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run Azure.sonic-utilities |
/AzurePipelines run Azure.sonic-utilities |
Azure Pipelines successfully started running 1 pipeline(s). |
Add flowcnt commands * counterpoll flowcnt-trap enable/disable * counterpoll flowcnt-trap interval * show flowcnt-trap stats
What I did
Add trap flow counter CLI support. See HLD: sonic-net/SONiC#858
How I did it
Add new command:
How to verify it
Unit test/Manual test
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)