Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/app/benchmarks/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,26 @@ export default async function BenchmarkPage({
// every click and the chart silently falls back to the previous variant,
// so two different region clicks render identical values.
const declaredRegions = aggregate.dimensions?.region ?? [];
// Snapshot region points are keyed by the spec entries' `region:` field
// (historically `ap-southeast`) while dimension values use `sgp`. Without
// canonicalizing, the data-presence filter below silently drops the
// Singapore tab on every bench (regression introduced with the filter:
// prod showed the tab before it shipped).
const REGION_KEY_ALIASES: Record<string, string> = {
"ap-southeast": "sgp",
sgp: "sgp",
};
const canonRegion = (r: string) => REGION_KEY_ALIASES[r] ?? r;
const regionsWithData = new Set<string>();
for (const points of Object.values(aggregate.extras.regions ?? {})) {
for (const pt of points as Array<{ region: string }>) {
if (pt?.region) regionsWithData.add(pt.region);
if (pt?.region) regionsWithData.add(canonRegion(pt.region));
}
}
const sbr = aggregate.extras.seriesByRegion24h ?? {};
for (const slug in sbr) {
for (const r in sbr[slug]) {
regionsWithData.add(r);
regionsWithData.add(canonRegion(r));
}
}
const regionOptions =
Expand Down
Loading