Skip to content

Extract MergeStats and DedupPollers to common/taskqueue for reuse#9401

Open
rkannan82 wants to merge 4 commits intokannan/mcn_matching/business-id-patternsfrom
kannan/mcn_matching/refactor-shared-stats
Open

Extract MergeStats and DedupPollers to common/taskqueue for reuse#9401
rkannan82 wants to merge 4 commits intokannan/mcn_matching/business-id-patternsfrom
kannan/mcn_matching/refactor-shared-stats

Conversation

@rkannan82
Copy link
Contributor

@rkannan82 rkannan82 commented Feb 25, 2026

What changed?

Extract shared task queue stats aggregation helpers (MergeStats, DedupPollers, AggregateStats) into common/taskqueue package and update the matching service to use them.

Why?

To repurpose these libraries when aggregating responses across cells.

How did you test it?

  • built
  • covered by existing tests
  • added new unit test(s) (common/taskqueue/stats_test.go - TestMergeStats, TestDedupPollers)
  • removed redundant TestOldestBacklogAge from matching_engine_test (covered by taskqueue tests)

Potential risks

Low. Pure refactor with no behavior change. The new package is used only by matching service code paths that previously had inline implementations.

rkannan82 and others added 2 commits February 23, 2026 14:16
Add business ID extraction patterns for additional WorkflowService APIs
to enable MCN single-cell routing based on various business identifiers.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add common/taskqueue/stats.go with MergeStats, DedupPollers, AggregateStats
- Update matching service to use shared helpers
- Remove duplicate implementations from physical_task_queue_manager,
  matching_engine, and task_queue_partition_manager

Made-with: Cursor
@rkannan82 rkannan82 requested review from a team as code owners February 25, 2026 21:57
@rkannan82 rkannan82 changed the base branch from main to kannan/mcn_matching/business-id-patterns February 25, 2026 22:00
Clone totalStats and merge partitionStats into it instead of merging
both into an empty struct. Same result, clearer intent.

Made-with: Cursor
@rkannan82 rkannan82 requested a review from ShahabT February 25, 2026 22:19
Use require.InDelta for float comparisons per testifylint. Also fix
import order per gci.

Made-with: Cursor
@rkannan82 rkannan82 force-pushed the kannan/mcn_matching/refactor-shared-stats branch from 81a575b to 09e9ef5 Compare February 25, 2026 22:30
@rkannan82 rkannan82 force-pushed the kannan/mcn_matching/business-id-patterns branch 2 times, most recently from 10aef0d to 96a62a9 Compare February 26, 2026 22:34
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.

1 participant