(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint)
| 1388 | private profileStages: boolean = process.env.CODEGRAPH_RESOLVE_PROFILE === '2'; |
| 1389 | |
| 1390 | private stageAdd(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint): void { |
| 1391 | if (!this.resolveProfile) return; |
| 1392 | const dt = process.hrtime.bigint() - t0; |
| 1393 | const key = `stage:${stage}|${ref.referenceKind}|${hit ? 'hit' : 'miss'}`; |
| 1394 | const slot = this.resolveProfile.get(key); |
| 1395 | if (slot) { |
| 1396 | slot.n++; |
| 1397 | slot.ns += dt; |
| 1398 | } else { |
| 1399 | this.resolveProfile.set(key, { n: 1, ns: dt }); |
| 1400 | } |
| 1401 | } |
| 1402 | |
| 1403 | private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null { |
| 1404 | if (!this.resolveProfile) return this.resolveOne(ref); |
no test coverage detected