MCPcopy
hub / github.com/codeaashu/claude-code / getSlowWarning

Function getSlowWarning

src/utils/queryProfiler.ts:98–124  ·  view source on GitHub ↗

* Identify slow operations (> 100ms delta)

(deltaMs: number, name: string)

Source from the content-addressed store, hash-verified

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