MCPcopy Index your code
hub / github.com/codeaashu/claude-code / buildTraceDocument

Function buildTraceDocument

src/utils/telemetry/perfettoTracing.ts:214–224  ·  view source on GitHub ↗

* Build the full trace document (Chrome Trace JSON format).

()

Source from the content-addressed store, hash-verified

212 * Build the full trace document (Chrome Trace JSON format).
213 */
214function 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

Callers 3

periodicWriteFunction · 0.85
writePerfettoTraceFunction · 0.85
writePerfettoTraceSyncFunction · 0.85

Calls 2

jsonStringifyFunction · 0.85
getSessionIdFunction · 0.85

Tested by

no test coverage detected