(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint)
| 2720 | private profileStages: boolean = process.env.CODEGRAPH_RESOLVE_PROFILE === '2'; |
| 2721 | |
| 2722 | private stageAdd(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint): void { |
| 2723 | if (!this.resolveProfile) return; |
| 2724 | const dt = process.hrtime.bigint() - t0; |
| 2725 | const key = `stage:${stage}|${ref.referenceKind}|${hit ? 'hit' : 'miss'}`; |
| 2726 | const slot = this.resolveProfile.get(key); |
| 2727 | if (slot) { |
| 2728 | slot.n++; |
| 2729 | slot.ns += dt; |
| 2730 | } else { |
| 2731 | this.resolveProfile.set(key, { n: 1, ns: dt }); |
| 2732 | } |
| 2733 | } |
| 2734 | |
| 2735 | private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null { |
| 2736 | if (!this.resolveProfile) return this.resolveOne(ref); |
no test coverage detected