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

Method stageAdd

src/resolution/index.ts:1398–1409  ·  view source on GitHub ↗
(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint)

Source from the content-addressed store, hash-verified

1396 private profileStages: boolean = process.env.CODEGRAPH_RESOLVE_PROFILE === '2';
1397
1398 private stageAdd(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint): void {
1399 if (!this.resolveProfile) return;
1400 const dt = process.hrtime.bigint() - t0;
1401 const key = `stage:${stage}|${ref.referenceKind}|${hit ? 'hit' : 'miss'}`;
1402 const slot = this.resolveProfile.get(key);
1403 if (slot) {
1404 slot.n++;
1405 slot.ns += dt;
1406 } else {
1407 this.resolveProfile.set(key, { n: 1, ns: dt });
1408 }
1409 }
1410
1411 private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null {
1412 if (!this.resolveProfile) return this.resolveOne(ref);

Callers 1

resolveOneMethod · 0.95

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected