Skip to content

[mmu probing] pr04.probe: Add observer pattern for metrics tracking#22542

Merged
XuChen-MSFT merged 2 commits intosonic-net:masterfrom
XuChen-MSFT:xuchen3/mmu_probe/pr04-observer
Mar 24, 2026
Merged

[mmu probing] pr04.probe: Add observer pattern for metrics tracking#22542
XuChen-MSFT merged 2 commits intosonic-net:masterfrom
XuChen-MSFT:xuchen3/mmu_probe/pr04-observer

Conversation

@XuChen-MSFT
Copy link
Contributor

@XuChen-MSFT XuChen-MSFT commented Feb 23, 2026

Description of PR

Summary:

Implement observer pattern for probing metrics collection and monitoring:

Observer Configuration:

  • ObserverConfig: Dataclass for observer behavior configuration Controls verbosity, detailed logging, and metrics tracking options

Observer Implementation:

  • ProbingObserver: Observer for probing iteration tracking Collects metrics including:
    • Iteration counts and outcomes (SUCCESS/DROP/XOFF)
    • Threshold detection events
    • Buffer state transitions
    • Timing measurements
    • Detailed iteration history for debugging

The observer pattern enables decoupled metrics collection without affecting algorithm logic, supporting both debugging and production monitoring use cases.

Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Approach

What is the motivation for this PR?

qos refactoring

How did you do it?

How did you verify/test it?

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

relevant PRs:
[mmu probing] pr01.docs: Add MMU threshold probing framework design
[mmu probing] pr02.probe: Add core probing algorithms with essential data structures
[mmu probing] pr03.probe: Add probing executors and executor registry
[mmu probing] pr04.probe: Add observer pattern for metrics tracking
[mmu probing] pr05.probe: Add stream manager and buffer occupancy controller
[mmu probing] pr06.probe: Add base framework and all probing implementations
[mmu probing] pr07.test: Add comprehensive unit tests for probe framework
[mmu probing] pr08.test: Add integration tests for end-to-end probing workflows
[mmu probing] pr09.test: Add production probe test and infrastructure updates

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

yxieca
yxieca previously approved these changes Feb 23, 2026
Copy link
Collaborator

@yxieca yxieca left a comment

Choose a reason for hiding this comment

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

Deep review done. Observer config/implementation looks sound; no issues found.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@yxieca yxieca left a comment

Choose a reason for hiding this comment

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

Re-reviewed updates; no new issues found.

Copy link
Contributor

@wsycqyz wsycqyz left a comment

Choose a reason for hiding this comment

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

lğtm

Implement observer pattern for probing metrics collection and monitoring:

Observer Configuration:
- ObserverConfig: Dataclass for observer behavior configuration
  Controls verbosity, detailed logging, and metrics tracking options

Observer Implementation:
- ProbingObserver: Observer for probing iteration tracking
  Collects metrics including:
  - Iteration counts and outcomes (SUCCESS/DROP/XOFF)
  - Threshold detection events
  - Buffer state transitions
  - Timing measurements
  - Detailed iteration history for debugging

The observer pattern enables decoupled metrics collection without
affecting algorithm logic, supporting both debugging and production
monitoring use cases.

Signed-off-by: Xu Chen <[email protected]>
Signed-off-by: Xu Chen <[email protected]>
@XuChen-MSFT XuChen-MSFT force-pushed the xuchen3/mmu_probe/pr04-observer branch from 6435552 to 404df42 Compare March 24, 2026 04:59
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@XuChen-MSFT XuChen-MSFT merged commit 89ba28d into sonic-net:master Mar 24, 2026
15 checks passed
ravaliyel pushed a commit to ravaliyel/sonic-mgmt that referenced this pull request Mar 27, 2026
…onic-net#22542)

* probe: Add observer pattern for metrics tracking

Implement observer pattern for probing metrics collection and monitoring:

Observer Configuration:
- ObserverConfig: Dataclass for observer behavior configuration
  Controls verbosity, detailed logging, and metrics tracking options

Observer Implementation:
- ProbingObserver: Observer for probing iteration tracking
  Collects metrics including:
  - Iteration counts and outcomes (SUCCESS/DROP/XOFF)
  - Threshold detection events
  - Buffer state transitions
  - Timing measurements
  - Detailed iteration history for debugging

The observer pattern enables decoupled metrics collection without
affecting algorithm logic, supporting both debugging and production
monitoring use cases.

Signed-off-by: Xu Chen <[email protected]>

* fix pre-commit errors

Signed-off-by: Xu Chen <[email protected]>

---------

Signed-off-by: Xu Chen <[email protected]>
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.

4 participants