Skip to content

Commit 72c189d

Browse files
committed
feat(site): include CPU engineering samples in dataset growth
The growth section's total, per-collection counts and newest point now add the satellite repo's catalog.json count. Earlier points are dump snapshots only, so the newest point shows the satellite as a step. Refs #19
1 parent 8e3e891 commit 72c189d

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

site/src/scripts/techapi.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ function countUp(node, target, opts = {}) {
231231
gpus: "GPUs",
232232
cpus: "CPUs",
233233
brands: "Brands",
234+
cpu_es: "CPU eng. samples",
234235
};
235236
const shortLabel = {
236237
games: "games",
@@ -245,6 +246,7 @@ function countUp(node, target, opts = {}) {
245246
gpus: "gpus",
246247
cpus: "cpus",
247248
brands: "brands",
249+
cpu_es: "cpu eng. samples",
248250
};
249251
const dumpPath = "site/public/v1/index.json";
250252
const countRows = (manifest) => {
@@ -465,7 +467,19 @@ function countUp(node, target, opts = {}) {
465467
renderHistory(points);
466468
}
467469

468-
getJSON("v1/index.json").then((manifest) => {
470+
// Satellite repos are not in the dump; fold their current count into the
471+
// latest snapshot so the total and the newest point include them.
472+
// ponytail: current count only, no back-history until satellites publish one.
473+
const withSatellites = (manifest) =>
474+
fetch("https://gettechapi.github.io/cpu-engineering-samples/catalog.json")
475+
.then((r) => (r.ok ? r.json() : Promise.reject()))
476+
.then((list) => {
477+
manifest.collections = { ...manifest.collections, cpu_es: { count: list.length } };
478+
return manifest;
479+
})
480+
.catch(() => manifest);
481+
482+
getJSON("v1/index.json").then(withSatellites).then((manifest) => {
469483
renderSnapshot(manifest);
470484
return loadCommitHistory(manifest).catch(() => {
471485
chartEl.innerHTML = '<div class="history-empty">Growth chart unavailable</div>';

0 commit comments

Comments
 (0)