| 1199 | } |
| 1200 | |
| 1201 | function summarize(samples) { |
| 1202 | if (!samples.length) { |
| 1203 | return null; |
| 1204 | } |
| 1205 | const sorted = samples.slice().sort((a, b) => a - b); |
| 1206 | const middle = Math.floor(sorted.length / 2); |
| 1207 | const median = |
| 1208 | sorted.length % 2 === 0 |
| 1209 | ? (sorted[middle - 1] + sorted[middle]) / 2 |
| 1210 | : sorted[middle]; |
| 1211 | return { |
| 1212 | min: sorted[0], |
| 1213 | max: sorted[sorted.length - 1], |
| 1214 | median, |
| 1215 | }; |
| 1216 | } |
| 1217 | |
| 1218 | function compareGroups(left, right) { |
| 1219 | const toolOrder = ["simdeck", "agent-device", "argent"]; |