Skip to content

TotalThroughput in the throughput report is the sum of per-endpoint peaks, not the peak daily total #5592

Description

@rebchr

Describe the bug

Description

The throughput report generated by the licensing component reports a TotalThroughput that does not match the published definition of daily throughput. The pricing definitions page defines maximum message throughput per day as:

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

That is: for each calendar day, sum the messages processed by all endpoints, then take the day with the highest total.

However, GenerateThroughputReport in src/Particular.LicensingComponent/ThroughputCollector.cs computes it the other way around: it first takes each endpoint's best single day (Throughput = endpointData.ThroughputData.MaxDailyThroughput()) and then sums those per-endpoint peaks (TotalThroughput = queueThroughputs.Sum(q => q.Throughput ?? 0)).

Unless every endpoint happens to peak on the same day, the sum of per-endpoint maxima is strictly greater than the maximum daily total. The more queues a system has and the longer the reporting window, the larger the overstatement — for a system with hundreds of queues reporting over many months, TotalThroughput can overstate the actual peak day severalfold. Since this report is used in licensing/tier conversations, the overstatement directly affects customers.

Example

Two endpoints, two days:

Day 1 Day 2 Endpoint max
Endpoint A 100 10 100
Endpoint B 20 100 100
Daily total 120 110
  • Reported TotalThroughput today: 100 + 100 = 200
  • Per the published definition: max(120, 110) = 120

Expected behavior

TotalThroughput equals the maximum over calendar days of the organization-wide daily sum, matching the published definition.

Versions

Observed in ServiceControl 6.18.0 (current master behaves the same; the unit test Should_return_correct_throughput_in_report_when_data_only_from_one_source encodes the sum-of-maxima expectation).

Additional context

I have a fix ready and will open a PR referencing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions