Skip to content

Usage report calculates negative endpoint throughput after queue table deletion#5404

Merged
mikeminutillo merged 1 commit into
masterfrom
fix-negative-throughput-when-queue-deleted
Apr 15, 2026
Merged

Usage report calculates negative endpoint throughput after queue table deletion#5404
mikeminutillo merged 1 commit into
masterfrom
fix-negative-throughput-when-queue-deleted

Conversation

@mikeminutillo

@mikeminutillo mikeminutillo commented Mar 27, 2026

Copy link
Copy Markdown
Member

Symptoms

Usage reports can contain negative throughput values for an endpoint/queue.

This can happen when a queue table is deleted between throughput snapshots.

Who's affected

Users generating usage reports where queue tables may have been deleted during the reporting period.

Root cause

Throughput is calculated by comparing two snapshots taken an hour apart.

When a queue table is deleted, the end-of-hour total is not set and defaults to 0, causing the calculation to produce a negative throughput value.

Confirmed workarounds

None

Original bug report While calculating throughput, when a queue table is deleted, we see a negative throughput entry recorded in the usage report for the day.

This happens because we take two snapshots, an hour apart, and then this to figure out how many messages have been processed:

totalThroughputForHour = totalMessagesEndOfHour - totalMessagesStartOfHour

When a table gets deleted, we do not set the totalMessagesEndOfHour which results in the default value of zero. This ends up looking like this:

totalThroughputForHour = 0 - totalMessagesStartOfHour

That is always going to be a negative number, and one that is not representative of the throughput in that hour.

@mikeminutillo mikeminutillo self-assigned this Mar 27, 2026
@mikeminutillo

Copy link
Copy Markdown
Member Author

This is in alignment with how the Endpoint Throughput Counter tool does it.

@johnsimons johnsimons left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@mikeminutillo mikeminutillo added this to the vNext milestone Apr 15, 2026
@mikeminutillo mikeminutillo merged commit 9fa1373 into master Apr 15, 2026
32 checks passed
@mikeminutillo mikeminutillo deleted the fix-negative-throughput-when-queue-deleted branch April 15, 2026 02:42
@jasontaylordev jasontaylordev modified the milestones: vNext, 6.15.0 May 27, 2026
@jasontaylordev jasontaylordev changed the title Do not return negative throughput when queue table deleted Usage report calculates negative endpoint throughput after queue table deletion May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants