(output, names)
| 211 | } |
| 212 | |
| 213 | function parseMetrics(output, names) { |
| 214 | const metrics = new Map() |
| 215 | for (const line of output.split(/\r?\n/)) { |
| 216 | const match = /^(.+?)\s+([0-9]+(?:\.[0-9]+)?)(?:ms|MB)?$/.exec(line.trim()) |
| 217 | if (!match) continue |
| 218 | const label = match[1].trim() |
| 219 | if (!names.includes(label)) continue |
| 220 | metrics.set(label, Number.parseFloat(match[2])) |
| 221 | } |
| 222 | return metrics |
| 223 | } |
| 224 | |
| 225 | function metricValues(samples, name) { |
| 226 | return samples |