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

Function profileReport

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

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected