(sessionIndex)
| 462 | // --------------------------------------------------------------------------- |
| 463 | |
| 464 | function buildSession(sessionIndex) { |
| 465 | const sessionRng = mulberry32(sessionIndex * 9973 + 1337); // deterministic per session |
| 466 | |
| 467 | const identity = generateIdentity(sessionIndex, sessionRng); |
| 468 | const group = getGroupForSession(sessionIndex); |
| 469 | const ua = makeUniqueUA(pick(USER_AGENTS, sessionRng), sessionIndex); |
| 470 | const ip = makeIP(sessionIndex); |
| 471 | const product = pick(PRODUCTS, sessionRng); |
| 472 | const scenarioFn = SCENARIOS[sessionIndex % SCENARIOS.length]; |
| 473 | const events = scenarioFn(product); |
| 474 | |
| 475 | return { identity, group, ua, ip, events }; |
| 476 | } |
| 477 | |
| 478 | // --------------------------------------------------------------------------- |
| 479 | // Schedule events across timeline |
no test coverage detected