(ref: UnresolvedRef)
| 1409 | } |
| 1410 | |
| 1411 | private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null { |
| 1412 | if (!this.resolveProfile) return this.resolveOne(ref); |
| 1413 | const t0 = process.hrtime.bigint(); |
| 1414 | const result = this.resolveOne(ref); |
| 1415 | const dt = process.hrtime.bigint() - t0; |
| 1416 | const key = result ? result.resolvedBy : `fail:${ref.referenceKind}`; |
| 1417 | const slot = this.resolveProfile.get(key); |
| 1418 | if (slot) { |
| 1419 | slot.n++; |
| 1420 | slot.ns += dt; |
| 1421 | } else { |
| 1422 | this.resolveProfile.set(key, { n: 1, ns: dt }); |
| 1423 | } |
| 1424 | return result; |
| 1425 | } |
| 1426 | |
| 1427 | /** Dump the CODEGRAPH_RESOLVE_PROFILE histogram to stderr (no-op when off). */ |
| 1428 | dumpResolveProfile(label: string): void { |
no test coverage detected