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

Method stageAdd

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

Source from the content-addressed store, hash-verified

1388 private profileStages: boolean = process.env.CODEGRAPH_RESOLVE_PROFILE === '2';
1389
1390 private stageAdd(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint): void {
1391 if (!this.resolveProfile) return;
1392 const dt = process.hrtime.bigint() - t0;
1393 const key = `stage:${stage}|${ref.referenceKind}|${hit ? 'hit' : 'miss'}`;
1394 const slot = this.resolveProfile.get(key);
1395 if (slot) {
1396 slot.n++;
1397 slot.ns += dt;
1398 } else {
1399 this.resolveProfile.set(key, { n: 1, ns: dt });
1400 }
1401 }
1402
1403 private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null {
1404 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