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

Method stageAdd

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

Source from the content-addressed store, hash-verified

2570 private profileStages: boolean = process.env.CODEGRAPH_RESOLVE_PROFILE === '2';
2571
2572 private stageAdd(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint): void {
2573 if (!this.resolveProfile) return;
2574 const dt = process.hrtime.bigint() - t0;
2575 const key = `stage:${stage}|${ref.referenceKind}|${hit ? 'hit' : 'miss'}`;
2576 const slot = this.resolveProfile.get(key);
2577 if (slot) {
2578 slot.n++;
2579 slot.ns += dt;
2580 } else {
2581 this.resolveProfile.set(key, { n: 1, ns: dt });
2582 }
2583 }
2584
2585 private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null {
2586 if (!this.resolveProfile) return this.resolveOne(ref);

Callers 1

resolveOneInnerMethod · 0.95

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected