MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getSlowWarning

Function getSlowWarning

source code/utils/queryProfiler.ts:100–126  ·  view source on GitHub ↗

* Identify slow operations (> 100ms delta)

(deltaMs: number, name: string)

Source from the content-addressed store, hash-verified

98 * Identify slow operations (> 100ms delta)
99 */
100function getSlowWarning(deltaMs: number, name: string): string {
101 // Don't flag the first checkpoint as slow - it measures time from process start,
102 // not actual processing overhead
103 if (name === 'query_user_input_received') {
104 return ''
105 }
106
107 if (deltaMs > 1000) {
108 return ` ⚠️ VERY SLOW`
109 }
110 if (deltaMs > 100) {
111 return ` ⚠️ SLOW`
112 }
113
114 // Specific warnings for known bottlenecks
115 if (name.includes('git_status') && deltaMs > 50) {
116 return ' ⚠️ git status'
117 }
118 if (name.includes('tool_schema') && deltaMs > 50) {
119 return ' ⚠️ tool schemas'
120 }
121 if (name.includes('client_creation') && deltaMs > 50) {
122 return ' ⚠️ client creation'
123 }
124
125 return ''
126}
127
128/**
129 * Get a formatted report of all checkpoints for the current/last query

Callers 1

getQueryProfileReportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected