(ip: string, i: number, e: number)
| 87 | // One event in a session: the entry is always a screen_view; the rest are a |
| 88 | // 50/50 mix of more screen_views and random custom events. |
| 89 | function sendSessionEvent(ip: string, i: number, e: number) { |
| 90 | if (e === 0 || Math.random() < 0.5) { |
| 91 | return screenView(ip, `/p${i}/${e}`, randomProps(ip)); |
| 92 | } |
| 93 | return track( |
| 94 | { type: 'track', payload: { name: pick(CUSTOM_EVENTS), properties: randomProps(ip) } }, |
| 95 | ip |
| 96 | ); |
| 97 | } |
| 98 | |
| 99 | async function emit(): Promise<Session[]> { |
| 100 | scenario(`emit ${SESSIONS} sessions × ${EVENTS_PER_SESSION} events (concurrency ${CONCURRENCY})`); |
no test coverage detected