The sessionizer groups each user's events into sessions. Since events started arriving from several collectors, the report shows sessions that start after they end, sessions that split when they should not, and blank use…
The sessionizer groups each user's events into sessions. Since events started arriving from several collectors, the report shows sessions that start after they end, sessions that split when they should not, and blank user IDs.
sessionize([{"user_id": "u1", "timestamp": 20}, {"user_id": "u1", "timestamp": 10}], 30).start 20 and end 10.timeout_seconds. A gap exactly equal to the timeout stays in the same session.count.user_id, or a negative timestamp, are skipped.start, then user_id.Unsorted input produces broken sessions, a gap equal to the timeout splits the session, and events with an empty user ID are kept.
The code lives in src/log_sessionizer.py. Read how LogSessionizer, EventParser, SessionPolicy, Event and Session work together before changing anything. Run the existing tests with pytest tests/visible.
Visible test command
pytest tests/visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
log-sessionizer
Changes under src/ are evaluated.