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

Method resolveOneTimed

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

Source from the content-addressed store, hash-verified

1401 }
1402
1403 private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null {
1404 if (!this.resolveProfile) return this.resolveOne(ref);
1405 const t0 = process.hrtime.bigint();
1406 const result = this.resolveOne(ref);
1407 const dt = process.hrtime.bigint() - t0;
1408 const key = result ? result.resolvedBy : `fail:${ref.referenceKind}`;
1409 const slot = this.resolveProfile.get(key);
1410 if (slot) {
1411 slot.n++;
1412 slot.ns += dt;
1413 } else {
1414 this.resolveProfile.set(key, { n: 1, ns: dt });
1415 }
1416 return result;
1417 }
1418
1419 /** Dump the CODEGRAPH_RESOLVE_PROFILE histogram to stderr (no-op when off). */
1420 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