(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint)
| 2570 | private profileStages: boolean = process.env.CODEGRAPH_RESOLVE_PROFILE === '2'; |
| 2571 | |
| 2572 | private stageAdd(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint): void { |
| 2573 | if (!this.resolveProfile) return; |
| 2574 | const dt = process.hrtime.bigint() - t0; |
| 2575 | const key = `stage:${stage}|${ref.referenceKind}|${hit ? 'hit' : 'miss'}`; |
| 2576 | const slot = this.resolveProfile.get(key); |
| 2577 | if (slot) { |
| 2578 | slot.n++; |
| 2579 | slot.ns += dt; |
| 2580 | } else { |
| 2581 | this.resolveProfile.set(key, { n: 1, ns: dt }); |
| 2582 | } |
| 2583 | } |
| 2584 | |
| 2585 | private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null { |
| 2586 | if (!this.resolveProfile) return this.resolveOne(ref); |
no test coverage detected