* Build the full trace document (Chrome Trace JSON format).
()
| 212 | * Build the full trace document (Chrome Trace JSON format). |
| 213 | */ |
| 214 | function buildTraceDocument(): string { |
| 215 | return jsonStringify({ |
| 216 | traceEvents: [...metadataEvents, ...events], |
| 217 | metadata: { |
| 218 | session_id: getSessionId(), |
| 219 | trace_start_time: new Date(startTimeMs).toISOString(), |
| 220 | agent_count: totalAgentCount, |
| 221 | total_event_count: metadataEvents.length + events.length, |
| 222 | }, |
| 223 | }) |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * Drop the oldest half of events[] when over MAX_EVENTS. Called from the |
no test coverage detected