MCPcopy Create free account
hub / github.com/csskit/csskit / buildSeries

Function buildSeries

website/script/benchmarks.js:449–468  ·  view source on GitHub ↗
(sampledEntries)

Source from the content-addressed store, hash-verified

447 const allFiles = Object.keys(entries[0].hyperfine_results);
448
449 function buildSeries(sampledEntries) {
450 return allFiles.map((file) => {
451 const dataPoints = sampledEntries
452 .map((entry) => {
453 const fileData = entry.hyperfine_results[file];
454 if (fileData && fileData.results && fileData.results[0]) {
455 return {
456 x: new Date(entry.timestamp).getTime(),
457 y: Math.round(fileData.results[0].mean * 1000000), // microseconds
458 };
459 }
460 return null;
461 })
462 .filter((point) => point !== null);
463 return {
464 name: file.replace(/\./g, " ").replace(/-/g, " "),
465 data: dataPoints,
466 };
467 });
468 }
469
470 const sampled = sampleEntries(entries);
471 const series = buildSeries(sampled);

Callers 6

createTimeChartFunction · 0.85
buildNormalSeriesFunction · 0.85
buildOutlierSeriesFunction · 0.85
createCompressionChartFunction · 0.85
createThroughputChartFunction · 0.85

Calls 2

roundMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected