Collect VFP rule counters in server diagnostics - #629
Merged
Debjit (mdebjit) merged 3 commits intoSep 1, 2026
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Collects VFP per-rule packet counters during server diagnostics.
Changes:
- Replaces
/list-rulecollection with/get-rule-counter. - Renames the generated diagnostic artifact accordingly.
Suppressed comments (1)
src/modules/SdnDiag.Server.psm1:408
- The central behavior change—invoking
/get-rule-counterand writing the renamed artifact—has no automated coverage intests/offline/Server.Tests.ps1, although that file provides Pester coverage for this module. Add a mockedGet-ServerConfigStatetest that verifies the command arguments and exported file name so a future edit cannot silently revert or omit rule-counter collection.
vfpctrl /get-rule-counter /port $($port.Name) | Export-ObjectToFile -FilePath $outputDir.FullName -Prefix $port.Name -Name 'vfpctrl_get_rule_counter' -FileType txt -Force
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Keeps the existing <port>_vfpctrl_list_rule.txt artifact so downstream collectors continue to find rule details, making the rule counter collection purely additive and non-breaking. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot stopped reviewing on behalf of
Debjit (mdebjit) due to an error
September 1, 2026 12:41
Adam Rudell (arudell)
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of changes:
Capture packet counters per rule along with the rule details.
The number of matched and dropped packets for each VFP rule is already being captured, but we currently do not retrieve this information. This change will include the packet counters for each rule as part of the rule details (see sample below).
Having this additional information will make it easier to debug complex datapath issues without incurring any additional overhead for recording the counters.
Before the fix:
After the fix:
Note for reviewers:
Change type
Checklist: