Skip to content

Use timer-based counter buffer flushing#1

Merged
avikalpg merged 1 commit into
masterfrom
nia/timer-based-counter-flush
May 31, 2026
Merged

Use timer-based counter buffer flushing#1
avikalpg merged 1 commit into
masterfrom
nia/timer-based-counter-flush

Conversation

@avikalpg

Copy link
Copy Markdown
Owner

Summary

  • replace lazy request-triggered flushing with a one-shot 2-minute timer per counter window
  • keep display values optimistic while pending counts are in memory
  • update the timing test so the minute-5 check expects one durable KV write

Test

  • npm test

Start a one-shot flush timer when a quiet counter window receives its first request so pending views become durable without waiting for a later visitor.

Update the timing test to assert the new minute-five flush behavior while keeping the one-write-per-window quota guard.
@avikalpg avikalpg merged commit 025d696 into master May 31, 2026
1 check passed
@avikalpg avikalpg deleted the nia/timer-based-counter-flush branch May 31, 2026 07:09
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