MCPcopy Create free account
hub / github.com/Noumena-Network/code / headlessProfilerCheckpoint

Function headlessProfilerCheckpoint

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

Source from the content-addressed store, hash-verified

82 * Only records if in headless mode and profiling is enabled.
83 */
84export function headlessProfilerCheckpoint(name: string): void {
85 // Only profile in headless/non-interactive mode
86 if (!getIsNonInteractiveSession()) return
87 // Only profile if enabled
88 if (!SHOULD_PROFILE) return
89
90 const perf = getPerformance()
91 perf.mark(`${MARK_PREFIX}${name}`)
92
93 if (DETAILED_PROFILING) {
94 logForDebugging(
95 `[headlessProfiler] Checkpoint: ${name} at ${perf.now().toFixed(1)}ms`,
96 )
97 }
98}
99
100/**
101 * 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 3

getPerformanceFunction · 0.85
logForDebuggingFunction · 0.70

Tested by

no test coverage detected