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

Method stageAdd

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

Source from the content-addressed store, hash-verified

2720 private profileStages: boolean = process.env.CODEGRAPH_RESOLVE_PROFILE === '2';
2721
2722 private stageAdd(stage: string, ref: UnresolvedRef, hit: boolean, t0: bigint): void {
2723 if (!this.resolveProfile) return;
2724 const dt = process.hrtime.bigint() - t0;
2725 const key = `stage:${stage}|${ref.referenceKind}|${hit ? 'hit' : 'miss'}`;
2726 const slot = this.resolveProfile.get(key);
2727 if (slot) {
2728 slot.n++;
2729 slot.ns += dt;
2730 } else {
2731 this.resolveProfile.set(key, { n: 1, ns: dt });
2732 }
2733 }
2734
2735 private resolveOneTimed(ref: UnresolvedRef): ResolvedRef | null {
2736 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