MCPcopy
hub / github.com/claude-code-best/claude-code / headlessProfilerStartTurn

Function headlessProfilerStartTurn

src/utils/headlessProfiler.ts:62–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 * and records turn_start. Call this at the beginning of each user message processing.
61 */
62export function headlessProfilerStartTurn(): void {
63 // Only profile in headless/non-interactive mode
64 if (!getIsNonInteractiveSession()) return
65 // Only profile if enabled
66 if (!SHOULD_PROFILE) return
67
68 currentTurnNumber++
69 clearHeadlessMarks()
70
71 const perf = getPerformance()
72 perf.mark(`${MARK_PREFIX}turn_start`)
73
74 if (DETAILED_PROFILING) {
75 logForDebugging(`[headlessProfiler] Started turn ${currentTurnNumber}`)
76 }
77}
78
79/**
80 * Record a checkpoint with the given name.

Callers 2

runHeadlessFunction · 0.85
drainCommandQueueFunction · 0.85

Calls 5

clearHeadlessMarksFunction · 0.85
getPerformanceFunction · 0.85
markMethod · 0.80
logForDebuggingFunction · 0.70

Tested by

no test coverage detected