(name: string)
| 81 | * Only records if in headless mode and profiling is enabled. |
| 82 | */ |
| 83 | export 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. |
no test coverage detected