Expand description
Counting traffic: every request (fed from the access-log path, so all protocols and whether or not lines are written) lands in hourly counts per host and group, daily unique visitors, and daily top lists.
Bounded by construction: MAX_HOSTS hosts (more go to other),
hourly buckets for retention_days, top lists of TOP entries a day
(the rest added to (other)), MAX_PENDING undecided browsers per
shard, a classification cache of MAX_CACHE per shard. Unique
visitors are counted with hash(secret, day, host, ip, user-agent) —
the secret is made at start and never stored, nor are the hashes — so
nobody can be followed from one day to the next and no IP or User-Agent
is kept.
A browser isn’t a person until it loads a stylesheet, script or font as
a browser rendering the page does: its requests wait in a pending record
and are counted as a person’s then, or as “browser, no assets” (a bot)
after UNDECIDED without one — or at once after 32 requests without
one.
Constants§
- MAX_
CACHE - Classifications cached per shard.
- MAX_
HOSTS - Hosts counted separately; others are
other. - MAX_
PENDING - Browsers awaiting their first asset, per shard.
- TOP
- Entries a daily top list keeps.
- TOP_
SAVED - Entries of each top list kept on disk and reported.
- UNDECIDED
- A browser that loads no asset this long after its last request isn’t a person.