Skip to main content

Module counts

Module counts 

Source
Expand description

The counts, and the ring each one is kept in.

Structsยง

Counts
Every count this process holds.
Ring ๐Ÿ”’
A ring of hourly counters, newest at head.

Constantsยง

BUCKETS
Hours in the ring, which is how long a day window is.
HELD
How many counts one Counts holds before it drops the ones that have aged out. A deployment holds far fewer accounts than this; the number is here so a deployment whose accounts come and go cannot grow the map without bound between deletions.
SECONDS_PER_BUCKET ๐Ÿ”’
Seconds in a bucket.

Functionsยง

hour_of
The hour now falls in, in whole hours since the epoch.
index ๐Ÿ”’

Type Aliasesยง

Key ๐Ÿ”’
What one count is kept under: the statement, and the account when the statement counts each account on its own.