MCPcopy
hub / github.com/colbymchenry/codegraph / runOne

Function runOne

scripts/agent-eval/repro-concurrent-explore.mjs:70–85  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

68}, 50);
69
70function runOne(i) {
71 const q = QUERIES[i % QUERIES.length];
72 const startedAt = performance.now();
73 let timer;
74 const timeout = new Promise((res) => {
75 timer = setTimeout(() => res({ timedOut: true }), TIMEOUT_MS);
76 });
77 const work = handler
78 .execute('codegraph_explore', { query: q })
79 .then((r) => ({ ok: !r.isError, chars: r.content?.[0]?.text?.length ?? 0 }))
80 .catch((e) => ({ ok: false, err: String(e?.message ?? e) }));
81 return Promise.race([work, timeout]).then((r) => {
82 clearTimeout(timer);
83 return { i, q, ms: Math.round(performance.now() - startedAt), ...r };
84 });
85}
86
87// Baseline: one warm single call (so the first-call cold paths don't skew N).
88const warmStart = performance.now();

Callers 1

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected