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

Function headlessProfilerCheckpoint

src/utils/headlessProfiler.ts:83–97  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

81 * Only records if in headless mode and profiling is enabled.
82 */
83export function headlessProfilerCheckpoint(name: string): void {
84 // Only profile in headless/non-interactive mode
85 if (!getIsNonInteractiveSession()) return
86 // Only profile if enabled
87 if (!SHOULD_PROFILE) return
88
89 const perf = getPerformance()
90 perf.mark(`${MARK_PREFIX}${name}`)
91
92 if (DETAILED_PROFILING) {
93 logForDebugging(
94 `[headlessProfiler] Checkpoint: ${name} at ${perf.now().toFixed(1)}ms`,
95 )
96 }
97}
98
99/**
100 * Log headless latency metrics for the current turn to Statsig.

Callers 6

submitMessageMethod · 0.85
queryLoopFunction · 0.85
runHeadlessFunction · 0.85
runFunction · 0.85
drainCommandQueueFunction · 0.85
queryModelFunction · 0.85

Calls 5

getPerformanceFunction · 0.85
markMethod · 0.80
nowMethod · 0.80
logForDebuggingFunction · 0.70

Tested by

no test coverage detected