MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / resolveOneTimed

Method resolveOneTimed

src/resolution/index.ts:1411–1425  ·  view source on GitHub ↗
(ref: UnresolvedRef)

Source from the content-addressed store, hash-verified

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 {

Callers 3

resolveAllMethod · 0.95
resolveBatchYieldingMethod · 0.95

Calls 3

resolveOneMethod · 0.95
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected