MCPcopy Create free account
hub / github.com/modem-dev/hunk / parseMetrics

Function parseMetrics

benchmarks/run.ts:107–121  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

105}
106
107function parseMetrics(output: string) {
108 const metrics = new Map<string, number>();
109 const metricPattern = /^METRIC\s+([A-Za-z0-9_.:-]+)=(-?\d+(?:\.\d+)?)$/;
110
111 for (const line of output.split(/\r?\n/)) {
112 const match = metricPattern.exec(line.trim());
113 if (!match) {
114 continue;
115 }
116
117 metrics.set(match[1]!, Number(match[2]!));
118 }
119
120 return metrics;
121}
122
123async function runScript(script: string) {
124 const proc = Bun.spawn(["bun", "run", `benchmarks/${script}`], {

Callers 1

runScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected