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

Function startUserInputPerfettoSpan

src/utils/telemetry/perfettoTracing.ts:768–796  ·  view source on GitHub ↗
(context?: string)

Source from the content-addressed store, hash-verified

766 * Start a user input waiting span
767 */
768export function startUserInputPerfettoSpan(context?: string): string {
769 if (!isEnabled) return ''
770
771 const spanId = generateSpanId()
772 const agentInfo = getCurrentAgentInfo()
773
774 pendingSpans.set(spanId, {
775 name: 'Waiting for User Input',
776 category: 'user_input',
777 startTime: getTimestamp(),
778 agentInfo,
779 args: {
780 context,
781 },
782 })
783
784 // Emit begin event
785 events.push({
786 name: 'Waiting for User Input',
787 cat: 'user_input',
788 ph: 'B',
789 ts: pendingSpans.get(spanId)!.startTime,
790 pid: agentInfo.processId,
791 tid: agentInfo.threadId,
792 args: pendingSpans.get(spanId)!.args,
793 })
794
795 return spanId
796}
797
798/**
799 * End a user input waiting span

Callers 1

Calls 6

generateSpanIdFunction · 0.85
getCurrentAgentInfoFunction · 0.85
getTimestampFunction · 0.85
getMethod · 0.65
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected