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