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

Method dumpResolveProfile

src/resolution/index.ts:1428–1440  ·  view source on GitHub ↗

Dump the CODEGRAPH_RESOLVE_PROFILE histogram to stderr (no-op when off).

(label: string)

Source from the content-addressed store, hash-verified

1426
1427 /** Dump the CODEGRAPH_RESOLVE_PROFILE histogram to stderr (no-op when off). */
1428 dumpResolveProfile(label: string): void {
1429 if (!this.resolveProfile || this.resolveProfile.size === 0) return;
1430 const rows = [...this.resolveProfile.entries()]
1431 .map(([k, v]) => ({ k, n: v.n, ms: Number(v.ns / 1_000_000n) }))
1432 .sort((a, b) => b.ms - a.ms);
1433 for (const r of rows) {
1434 console.error(
1435 `[resolve-profile] ${label} ${r.k}: n=${r.n} total=${(r.ms / 1000).toFixed(1)}s avg=${((r.ms * 1000) / Math.max(1, r.n)).toFixed(0)}µs`
1436 );
1437 }
1438 // =2 only: this thread's matchReference sub-stage table rides along.
1439 dumpNameMatcherProfile(label);
1440 }
1441
1442 resolveListForAdmission(refs: UnresolvedReference[]): {
1443 resolved: ResolvedRef[];

Callers 2

resolver-worker.tsFile · 0.80

Calls 2

dumpNameMatcherProfileFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected