Loop/Session

From MozillaWiki
Jump to: navigation, search

Unfortunately, "session" has 2 distinct meanings in a Loop context:

  1. A strong entity maintained by TokBox that has a 1-to-1 mapping to our rooms
  2. The simultaneous presence of 2 people in a room. A session in this sense begins when the number of people in a room rises to 2 and ends when one of them leaves.

This page is about sense #2.

Measurement

Sessions are, at the moment, computed differently for different metrics:

  • The Session Progress graph uses the "linkclicker theorem" (≤1 linkclicker in a room at once, ≤1 Fx user in a room at once) as an aid to deciding when 2 people are in a room. The following counts as 2 sessions: A joins, B joins, A leaves, A rejoins. A user is also considered to have left if he goes 5 minutes without network activity.
  • The code behind the Room Sessions graph ("the sessionizer") doesn't use the linkclicker theorem. It's all based on uids (Hawk IDs). It currently assumes all "unknown" (linkclicker) UIDs are the same person. Previously, it assumed they are all different people. Neither assumption is accurate; they didn't have the userType data when they wrote the Lua code. ErikRose believes whd or twist are going to update it to match the Session Progress algorithm.
  • Google Analytics should be pretty close to the Session Progress numbers, but there may be small deviations due to differences in handling timeouts and other corner cases. Upon successful connection between 2 parties and the start of a stream, we trigger an event to Google Analytics. 2 discrete conversations in 1 room count twice toward GA’s Media Connected events.
  • Tokbox's idea of sessions is entirely different: they care about a persistent stream allocated on their end, which is not usefully comparable to any of the above concepts.