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

Function profileReport

src/utils/startupProfiler.ts:123–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121let reported = false
122
123export function profileReport(): void {
124 if (reported) return
125 reported = true
126
127 // Log to Statsig (sampled: 100% ant, 0.1% external)
128 logStartupPerf()
129
130 // Output detailed report if CLAUDE_CODE_PROFILE_STARTUP=1
131 if (DETAILED_PROFILING) {
132 // Write to file
133 const path = getStartupPerfLogPath()
134 const dir = dirname(path)
135 const fs = getFsImplementation()
136 fs.mkdirSync(dir)
137 writeFileSync_DEPRECATED(path, getReport(), {
138 encoding: 'utf8',
139 flush: true,
140 })
141
142 logForDebugging('Startup profiling report:')
143 logForDebugging(getReport())
144 }
145}
146
147export function isDetailedProfilingEnabled(): boolean {
148 return DETAILED_PROFILING

Callers 2

runFunction · 0.85
gracefulShutdownFunction · 0.85

Calls 6

logStartupPerfFunction · 0.85
getStartupPerfLogPathFunction · 0.85
getFsImplementationFunction · 0.85
writeFileSync_DEPRECATEDFunction · 0.85
getReportFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected