SEO + AEO on AutopilotFrom the team at Stackmatix
The Growth Library

Distinguish Calendar Resets From Rolling Usage Windows

Replay fixed and sliding usage windows with exact timestamp queues, retaining expiration rules, rejected-attempt treatment and separate histories.

Audit a usage-window answer by replaying the actual arrival timestamps under the documented counting rule. A calendar reset and a sliding lookback can disagree immediately after a boundary, even when both are described as three requests per minute.

Use a timestamp queue for a continuous sliding-window model and calendar buckets for a fixed-window model. The artifact must preserve which arrivals count, which expire and whether rejected attempts change the history. Relative phrases such as last month are not the issue here; admission depends on a concrete event-membership algorithm.

Identify the implemented window mechanism

Record the limit, duration, scope, time basis, endpoint convention and counted event type. Determine whether the system counts attempts, admitted requests, completed operations or another event. A rejected request may or may not consume allowance under the real policy.

Microsoft's ASP.NET Core rate-limiting documentation describes fixed-window and sliding-window limiters, including segmented sliding windows. That is a specific implementation model. The exact continuous timestamp queue below is an original fictional contract, not a claim that Microsoft's segmented implementation makes identical boundary decisions.

Do not treat every limiter called sliding window as interchangeable. The stored state and expiration granularity matter. Verify the actual source before comparing an observed rejection with a theoretical model.

Freeze two complete fictional contracts

Both teaching contracts allow at most three admitted requests under their stated counting rule. Contract F counts requests in UTC calendar-minute buckets. At the start of a new minute, its new bucket starts empty.

Contract S counts admitted arrivals in the preceding sixty seconds using the interval strictly after t minus sixty seconds and through t. A rejected attempt is not added to its queue. There is no separate token refill, concurrency limit or other traffic.

For the candidate request, remove expired arrivals first, inspect the retained count, and admit only if adding the request stays within three. These are invented rules, not guarantees about a named provider.

Populate the shared starting history

Assume three requests were admitted at 23:59:20, 23:59:40 and 23:59:50 on the same fictional UTC date. Each is one request. The next candidate arrives at 00:00:10 on the following date.

Model at 00:00:10Counting IntervalPrior Requests RetainedCandidate Decision
Fixed calendar minute FCurrent minute beginning 00:00:000Admit; new count 1
Continuous sliding window SAfter 23:59:10 through 00:00:103Reject; retained count stays 3

The calendar changed, but none of S's three arrivals is sixty seconds old yet. An answer saying “the limit resets at midnight, so the request fits” is unsupported if the inspected source specifies Contract S.

The same statement can be correct under Contract F, subject to its actual scope and history. The discrepancy is a different counting algorithm, not an arithmetic mistake or a universal problem with calendar labels.

Advance the sliding queue explicitly

Evaluate a new candidate at 00:00:21 under S, retaining its earlier rejection at 00:00:10 as a non-counted attempt. The lookback begins strictly after 23:59:21, so the 23:59:20 arrival has expired. The 23:59:40 and 23:59:50 arrivals remain.

Two counted arrivals remain, so the new candidate can be admitted as the third. The resulting queue contains 23:59:40, 23:59:50 and 00:00:21.

Do not mix the branches' histories. F admitted the 00:00:10 request, while S rejected it. Later comparisons must carry forward each model's own accepted events rather than using one shared count after their decisions diverge.

Make the endpoint rule testable

Under S's declared interval, an arrival exactly sixty seconds old is excluded. At 00:00:20, the 23:59:20 arrival is therefore outside the retained queue. A source that uses a different inclusion rule could make a different exact-boundary decision.

Record that convention rather than hiding it behind the word within. A fixture just before, exactly at and just after expiration can expose a one-boundary error that ordinary timestamps never reveal.

The number check should reproduce elapsed seconds and queue membership. It should not replace the rule with calendar subtraction simply because both can be described using a minute.

Distinguish the queue from a token bucket

A token bucket replenishes a balance according to its own capacity and refill policy. This model expires discrete counted arrivals based on their timestamps. Idle time can change both systems, but through different state transitions.

Likewise, a task finishing does not remove an arrival from S unless its policy explicitly ties counting to completion. The stock-capacity ledger addresses reserved and committed occupancy, a different resource model.

An answer should name the mechanism that the source actually establishes. It cannot infer rolling behavior from a rate alone, or infer a token bucket because a dashboard displays a remaining count.

Verify scope and observation completeness

A queue for one client does not establish an account-wide count if other clients share the allowance. Record the namespace, caller identity where relevant and whether all counted arrivals are available in the evidence.

Keep clock uncertainty visible. Server receipt time, client send time and completed-operation time may differ. Use the event time the actual policy defines rather than choosing whichever timestamp produces the desired pass.

The source record should preserve the actual window algorithm, counted event and endpoint rule. A source with only a marketing rate label may leave a specific admission decision unverified.

Check the queue input order

A replay assembled from an exported log needs an explicit ordering check. A queue implementation that removes expired events only from its head assumes those events are ordered by the policy’s relevant time. An unsorted export can leave an old arrival behind a newer one and produce the wrong retained count. Preserve stable event identities, verify the chosen ordering, and keep genuinely unresolved simultaneous ordering separate from a deterministic display sort. The teaching history is already ordered; that fact is an input, not a universal property of logs.

Build a complete boundary replay

Retain the initial accepted history, candidate arrivals, expired events, retained queue, decisions and resulting state. Include a calendar rollover and an exact-expiration case in the local teaching fixtures.

Use the prerequisite matrix for other constraints and permissions. A request fitting the window does not prove that every other admission condition is satisfied or that the operation will finish.

The final answer should explain why F admits at 00:00:10 while S rejects, and why S can admit after its oldest event expires. That concrete replay is more useful than repeating that a product offers three requests per minute without establishing what that phrase means.

Sources

Matt Pru

Co-founder and CEO of Stackmatix. Writing about growth, customer acquisition, and the decisions behind useful marketing. Connect on LinkedIn.

Developed with AI assistance under Matt's editorial direction. Our Editorial Approach