Analysts want to measure how long each visitor lingers inside a single gallery by grouping that visitor's motion-sensor pings together whenever consecutive pings are no more than two minutes apart, and starting a new group whenever a gap of more than two minutes occurs. Which windowing function models this directly?
Select an answer to reveal the explanation.
Short Explanation
A session window doesn't run on a clock at all — it just watches for a gap. As long as pings keep coming within two minutes of each other they stay one visit; once two minutes of silence pass, that visit closes and the next ping starts a new one.
Full Explanation
A session window groups events by activity rather than by a fixed clock: it stays open as long as consecutive events arrive within the configured inactivity gap, and it closes — finalizing that group — the moment the gap between one event and the next exceeds the threshold. A two-minute gap threshold applied to a visitor's motion pings produces exactly one group per continuous dwell in the gallery, which is precisely a variable-length 'visit' rather than a fixed time slice.
A tumbling window with a two-minute duration would instead chop a single continuous visit into multiple fixed two-minute segments regardless of whether the visitor kept moving the whole time, which does not measure dwell time as a coherent unit. A hopping window compounds that problem by additionally overlapping those fixed segments, which is even less suited to counting a single dwell period once. A snapshot window groups only events sharing an identical timestamp, an unrelated concept that has nothing to do with gaps in activity over a span of minutes.
A caveat: choosing too short a gap threshold can artificially split one real visit into several sessions if the visitor pauses briefly (say, to read a placard) longer than the threshold, so the gap value should reflect realistic visitor behavior. Operationally, validate the configuration by tracing one known visitor's raw ping timestamps and confirming they collapse into the expected number of session groups.