-
Notifications
You must be signed in to change notification settings - Fork 270
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
Fix flex counters logic of converting poll interval to seconds from MS #878
Conversation
syncd/FlexCounter.cpp
Outdated
@@ -1597,7 +1597,7 @@ void FlexCounter::runPlugins( | |||
{ | |||
std::to_string(counters_db.getDbId()), | |||
COUNTERS_TABLE, | |||
std::to_string(m_pollInterval * 1000) | |||
std::to_string(m_pollInterval / 1000) |
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.
m_pollInterval is set via orchagent with values in milliseconds (MS), currently this value was extended to microseconds, and now you changing this to seconds, so if m_pollInterval will be equal to let say 60ms or 100ms or 900ms, then your value in db will be set to zero (0) because of integer division, is that what you want ?
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.
Done - removed the multiplication and did the required multiplication in the lua script - sonic-net/sonic-swss#1855
bb95461
to
eb3aae7
Compare
eb3aae7
to
e9db3dd
Compare
@kcudnik could you please help review? |
i already posted my concerns in comment above, and still this is not addressed nor responded how this will be handled |
@kcudnik Hi Kamil, |
i still don't see consistency here, what value is set in OA, what pooliterval value is stored in db and what value valie of pollinterval i passed to lua script |
Hi Kamil. The value set in CLI is in milliseconds which is again set as milliseconds in orchagent. This value is again passed to lua script in milliseconds. So end to end we are using milliseconds. The lua scripts are updated to treat the input arg in milliseconds which is here sonic-net/sonic-swss#1855 |
thanks for deep answer on that, now i get the flow |
@noaOrMlnx could you please review the failures? |
… to get real results
e9db3dd
to
d178409
Compare
… to get real results
@kcudnik could you please re-approve? |
The PR check "license/cla" seems have some issue. Could you commit an empty commit, to retrigger the check. |
… into flexcounter_fix
a83386e
to
32556a3
Compare
@qiluo-msft Done |
@kcudnik Could you review again, and merge after all checkers pass? |
#878) According to https://github.com/Azure/SONiC/blob/ec6d35dd2c28491bfade19cfee990fe612f1e5e9/doc/rates-and-utilization/Rates_and_utilization_HLD.md, counterpoll command gives polling interval in milliseconds. So when converting them to seconds to be supplied to lua script this should be divide by 1000. However, syncd multiplies it by 1000. Changed the multiplication to none, and did the converting in lua script - sonic-net/sonic-swss#1855 Fixed issue - sonic-net/sonic-buildimage#8392
… MS (#1855) **What I did** Update the rif_rates/lua script to multiply by 1000 instead of FlexCounter class. related also to this PR - sonic-net/sonic-sairedis#878 Fix issue - sonic-net/sonic-buildimage#8392 **Why I did it** times were not calculated properly. **How I verified it** check that the output of cli and redis is close enough:
… MS (#1855) **What I did** Update the rif_rates/lua script to multiply by 1000 instead of FlexCounter class. related also to this PR - sonic-net/sonic-sairedis#878 Fix issue - sonic-net/sonic-buildimage#8392 **Why I did it** times were not calculated properly. **How I verified it** check that the output of cli and redis is close enough:
PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". sonic-net/sonic-sairedis#878 Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * sonic-net/sonic-sairedis#878 Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
… MS (#1855) **What I did** Update the rif_rates/lua script to multiply by 1000 instead of FlexCounter class. related also to this PR - sonic-net/sonic-sairedis#878 Fix issue - sonic-net/sonic-buildimage#8392 **Why I did it** times were not calculated properly. **How I verified it** check that the output of cli and redis is close enough:
PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * sonic-net/sonic-sairedis#878 Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * sonic-net/sonic-sairedis#878 Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
…#1909) **What I did** Converted polling interval from milliseconds to microseconds in PFCWD LUA scripts. Same as PR #1908 but created directly against ```202012``` release branch **Why I did it** PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * sonic-net/sonic-sairedis#878 So need to convert values to microseconds (as it was before) in order to make PFCWD working, **How I verified it** Ran PFCWD tests from sonic-mgmt.
**What I did** Converted polling interval from milliseconds to microseconds in PFCWD LUA scripts. **Why I did it** PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * sonic-net/sonic-sairedis#878 So need to convert values to microseconds (as it was before) in order to make PFCWD working, **How I verified it** Ran PFCWD tests from sonic-mgmt.
Fixes sonic-net/sonic-buildimage#8773 Pfcwd regressions were observed due to the changes in the PR sonic-net/sonic-sairedis#878. Hence aligning the polling interval in lua script to use microseconds **How I verified it** Ran pfcwd tests that were failing prior to this change and they passed
Fixes sonic-net/sonic-buildimage#8773 Pfcwd regressions were observed due to the changes in the PR sonic-net/sonic-sairedis#878. Hence aligning the polling interval in lua script to use microseconds **How I verified it** Ran pfcwd tests that were failing prior to this change and they passed
Fixes sonic-net/sonic-buildimage#8773 Pfcwd regressions were observed due to the changes in the PR sonic-net/sonic-sairedis#878. Hence aligning the polling interval in lua script to use microseconds **How I verified it** Ran pfcwd tests that were failing prior to this change and they passed
#878) According to https://github.com/Azure/SONiC/blob/ec6d35dd2c28491bfade19cfee990fe612f1e5e9/doc/rates-and-utilization/Rates_and_utilization_HLD.md, counterpoll command gives polling interval in milliseconds. So when converting them to seconds to be supplied to lua script this should be divide by 1000. However, syncd multiplies it by 1000. Changed the multiplication to none, and did the converting in lua script - sonic-net/sonic-swss#1855 Fixed issue - sonic-net/sonic-buildimage#8392
… MS (sonic-net#1855) **What I did** Update the rif_rates/lua script to multiply by 1000 instead of FlexCounter class. related also to this PR - sonic-net/sonic-sairedis#878 Fix issue - sonic-net/sonic-buildimage#8392 **Why I did it** times were not calculated properly. **How I verified it** check that the output of cli and redis is close enough:
…net#1908) **What I did** Converted polling interval from milliseconds to microseconds in PFCWD LUA scripts. **Why I did it** PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * sonic-net/sonic-sairedis#878 So need to convert values to microseconds (as it was before) in order to make PFCWD working, **How I verified it** Ran PFCWD tests from sonic-mgmt.
Fixes sonic-net/sonic-buildimage#8773 Pfcwd regressions were observed due to the changes in the PR sonic-net/sonic-sairedis#878. Hence aligning the polling interval in lua script to use microseconds **How I verified it** Ran pfcwd tests that were failing prior to this change and they passed
**What I did** Converted polling interval from milliseconds to microseconds in PFCWD LUA scripts. **Why I did it** PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * sonic-net/sonic-sairedis#878 So need to convert values to microseconds (as it was before) in order to make PFCWD working, **How I verified it** Ran PFCWD tests from sonic-mgmt.
PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * sonic-net/sonic-sairedis#878 Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
sonic-net#878) According to https://github.com/Azure/SONiC/blob/ec6d35dd2c28491bfade19cfee990fe612f1e5e9/doc/rates-and-utilization/Rates_and_utilization_HLD.md, counterpoll command gives polling interval in milliseconds. So when converting them to seconds to be supplied to lua script this should be divide by 1000. However, syncd multiplies it by 1000. Changed the multiplication to none, and did the converting in lua script - sonic-net/sonic-swss#1855 Fixed issue - sonic-net/sonic-buildimage#8392
According to https://github.com/Azure/SONiC/blob/ec6d35dd2c28491bfade19cfee990fe612f1e5e9/doc/rates-and-utilization/Rates_and_utilization_HLD.md, counterpoll command gives polling interval in milliseconds.
So when converting them to seconds to be supplied to lua script this should be divide by 1000. However, syncd multiplies it by 1000.
Changed the multiplication to none, and did the converting in lua script - sonic-net/sonic-swss#1855
Fixed issue - sonic-net/sonic-buildimage#8392