Skip to content
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 LocalSecGrpClassifierCounter #581

Merged
merged 1 commit into from
Aug 8, 2024
Merged

Add LocalSecGrpClassifierCounter #581

merged 1 commit into from
Aug 8, 2024

Conversation

mchalla
Copy link
Contributor

@mchalla mchalla commented Aug 1, 2024

  • added as an extension of SecGrpClassifierCounter
  • added make checks as a copy of SecGrpStatsManager_test.cpp, replacing all the classifiers with Local, and convert the called functions to use template arguments.
  • The make checks cover the prometheus tests
  • this would also result in pushing the LocalSecGrpClassifierCounter to the leaf, should we decide to push the local secgrps to the leaf, we can strip the Local before sending it.

@coveralls
Copy link
Collaborator

coveralls commented Aug 1, 2024

Coverage Status

coverage: 78.445% (-0.03%) from 78.472%
when pulling 4b0b5d1 on local-hpp-counters
into 2ea7e51 on master.

@mchalla
Copy link
Contributor Author

mchalla commented Aug 1, 2024

I missed changing testSecGrpDelete to use local classifier. I am seeing an issue where deleting the classifier is not deleting the counter for local case and will update with a fix.

- added as an extension of SecGrpClassifierCounter
- added make checks as a copy of SecGrpStatsManager_test.cpp,
  replacing all the classifiers with Local, and convert the
  called functions to use template arguments.
- PolicyStatsManager also listens to LocalL24Classifiers
- The make checks cover the prometheus tests
- this would also result in pushing the LocalSecGrpClassifierCounter
  to the leaf, should we decide to push the local secgrps to the
  leaf, we can strip the Local before sending it.

The following is the mapping
L24Classifier <Contract> L24ClassifierCounter
L24Classifier <SecGroup> SecGrpClassifierCounter
LocalL24Classifier <LocalSecGroup> LocalSecGrpClassifierCounter

Signed-off-by: Madhu Challa <[email protected]>
@mchalla
Copy link
Contributor Author

mchalla commented Aug 1, 2024

I missed changing testSecGrpDelete to use local classifier. I am seeing an issue where deleting the classifier is not deleting the counter for local case and will update with a fix.

The issue was the policy stats manager not listening to locall24classifier events. After fixing it the test passes.

@mchalla mchalla closed this Aug 1, 2024
@mchalla mchalla reopened this Aug 1, 2024
@@ -46,7 +47,8 @@ using boost::system::error_code;
SecGrpStatsManager::SecGrpStatsManager(Agent* agent_, IdGenerator& idGen_,
SwitchManager& switchManager_,
long timer_interval_)
: PolicyStatsManager(agent_,idGen_,switchManager_,timer_interval_) {
: PolicyStatsManager(agent_,idGen_,switchManager_,timer_interval_),
agent(agent_) {
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to store Agent* in the SecGrpStatsManager subclass as well. It's protected in the superclass. Can't you just access it from there as needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh i did not realize that. i will change it via a separate commit since i already merged this change.

@mchalla mchalla merged commit 0c9547e into master Aug 8, 2024
6 checks passed
@mchalla mchalla deleted the local-hpp-counters branch August 8, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants