MCPcopy Index your code
hub / github.com/cameri/nostream / measure

Function measure

scripts/verify-index-impact.ts:274–291  ·  view source on GitHub ↗
(testCase: BenchmarkCase)

Source from the content-addressed store, hash-verified

272}
273
274async function measure(testCase: BenchmarkCase): Promise<MeasureResult> {
275 const runs: ExplainResult[] = []
276 for (let i = 0; i < RUNS; i++) {
277 runs.push(await explain(testCase.sql, testCase.params))
278 }
279 const summaries = runs.map(summarize)
280 const exec = summaries.map((s) => s.execMs).sort((a, b) => a - b)
281 const median = exec[Math.floor(exec.length / 2)]
282 const min = exec[0]
283 const max = exec[exec.length - 1]
284 return {
285 indexes: summaries[0]?.indexes ?? [],
286 nodeTypes: summaries[0]?.nodeTypes ?? [],
287 min,
288 median,
289 max,
290 }
291}
292
293async function main(): Promise<void> {
294 await client.connect()

Callers 1

mainFunction · 0.85

Calls 1

explainFunction · 0.70

Tested by

no test coverage detected