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

Function endInteractionPerfettoSpan

src/utils/telemetry/perfettoTracing.ts:918–942  ·  view source on GitHub ↗
(spanId: string)

Source from the content-addressed store, hash-verified

916 * End an interaction span
917 */
918export function endInteractionPerfettoSpan(spanId: string): void {
919 if (!isEnabled || !spanId) return
920
921 const pending = pendingSpans.get(spanId)
922 if (!pending) return
923
924 const endTime = getTimestamp()
925 const duration = endTime - pending.startTime
926
927 // Emit end event
928 events.push({
929 name: pending.name,
930 cat: pending.category,
931 ph: 'E',
932 ts: endTime,
933 pid: pending.agentInfo.processId,
934 tid: pending.agentInfo.threadId,
935 args: {
936 ...pending.args,
937 duration_ms: duration / 1000,
938 },
939 })
940
941 pendingSpans.delete(spanId)
942}
943
944// ---------------------------------------------------------------------------
945// Periodic write helpers

Callers 1

endInteractionSpanFunction · 0.85

Calls 4

getTimestampFunction · 0.85
getMethod · 0.65
deleteMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected