Skip to content

Calculate TotalThroughput as the maximum organization-wide daily total#5593

Open
rebchr wants to merge 1 commit into
Particular:masterfrom
rebchr:fix-total-throughput-max-daily-sum
Open

Calculate TotalThroughput as the maximum organization-wide daily total#5593
rebchr wants to merge 1 commit into
Particular:masterfrom
rebchr:fix-total-throughput-max-daily-sum

Conversation

@rebchr

@rebchr rebchr commented Jul 9, 2026

Copy link
Copy Markdown

Fixes:

What

TotalThroughput in the throughput report is now the maximum over calendar days of the organization-wide daily total, instead of the sum of each endpoint's individual best day. This matches the published definition of maximum message throughput per day at particular.net/pricing/definitions:

The maximum number of messages processed by all NServiceBus endpoints across the entire organization in a day.

Why

The previous calculation (queueThroughputs.Sum(q => q.Throughput), where each queue's Throughput is its own peak day) counts every endpoint's peak as if they all occurred on the same day. Unless all endpoints peak simultaneously, this is strictly greater than the actual busiest day, and the overstatement grows with the number of queues and the length of the reporting window. Since the report is used in licensing conversations, the reported number should match the definition it is measured against.

Example — two endpoints, two days: A = [100, 10], B = [20, 100]. Previous TotalThroughput: 200. Actual busiest day: 120.

How

  • New DailyThroughput() extension yields an endpoint's per-day values; when multiple sources have data for the same day, the maximum value is used, consistent with the existing per-endpoint MaxDailyThroughput() semantics (all sources measure the same messages).
  • GenerateThroughputReport accumulates daily totals across all endpoints in the existing loop and sets TotalThroughput to the highest daily total (0 when there is no data).
  • The per-queue Throughput field is unchanged, so TotalThroughput remains ≥ every per-queue value. The set of queues contributing to the total is also unchanged.
  • Added a test that encodes the definition (endpoints peaking on different days). Updated the one assertion and one approval file that encoded the previous sum-of-peaks behavior (195 → 185, 249 → 238).

All tests in Particular.LicensingComponent.UnitTests pass (75/75).

🤖 Generated with Claude Code

The throughput report previously set TotalThroughput to the sum of each
endpoint's individual best day. Endpoints that peak on different days were
counted as if their peaks occurred on the same day, overstating actual
throughput - increasingly so with more queues and longer reporting windows.

Per the published definition of daily throughput (maximum number of messages
processed by all NServiceBus endpoints across the entire organization in a
day), the daily totals must be summed across endpoints first, and the
maximum taken over days. When multiple sources report data for the same
endpoint and day, the maximum value is used, consistent with the existing
per-endpoint MaxDailyThroughput semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Jul 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants