Visits, worked out rather than stored

'How many visits' is computed by grouping an employee's recorded events with a thirty-minute idle gap, rather than by minting and tracking session ids.

What it is

A grouping rule applied at read time. Events belonging to one actor are folded into a visit whenever the gap between them is under thirty minutes, producing a start, an end, a duration, per-kind counts and a one-line summary of where they were and what they did.

Also called: session grouping · how many visits · how long were they in there

See it
Visits, worked out rather than stored
Area
Operations
Group
Audit
System
Multi-Tenancy & Identity
Solves
3 named problems
01Events are ordered per actor and split wherever the idle gap exceeds thirty minutes.
02Each group yields start and end times, minutes, counts by kind, and a summary line.
03Consecutive identical events are folded with a repeat count so a session reads cleanly.
A collapsed session row — actor, account, start/end, minutes, counts — expanding into its individual events. src/app/platform/audit/page.tsx. Sample data — no customer information appears here.
How it works
  1. 1Events are ordered per actor and split wherever the idle gap exceeds thirty minutes.
  2. 2Each group yields start and end times, minutes, counts by kind, and a summary line.
  3. 3Consecutive identical events are folded with a repeat count so a session reads cleanly.
  4. 4The same thirty-minute window is used by the account-entry throttle, so one visit leaves one entry row.
Why we built it

The reasoning is about durability rather than convenience: 'A stored session id would have to survive token refreshes, multiple tabs and subdomain hops to stay honest; a gap rule needs none of that and can be recomputed differently later without a migration.' Aligning the entry throttle to the same window is what keeps the two views consistent — 'one visit should leave one enter row.'

The problem
  • Stored session ids drift out of honesty across tabs, refreshes and host hops.
  • A raw event list doesn't answer 'how many visits' or 'how long'.
  • Changing the definition of a session would otherwise require a migration.
Sound familiar?
What you get
Visit counts and durations without a fragile session-tracking mechanism.
The rule can be changed later without touching stored data.
One visit reads as one entry, not hundreds.

See it on your own jobs

Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.

or keep browsing features →