Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 21 additions & 1 deletion src/app/api/freshness/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,29 @@ const computeFreshness = unstable_cache(
for (const [slug, asOf] of entries) {
if (asOf != null) freshness[slug] = asOf;
}
// Store fallback: the Vercel site has no PROMETHEUS_URL (Prom lives
// on a private VPS), so on prod every probe above fails and this
// map came back EMPTY since launch, blanking the LiveIndicator.
// The materialized blobs carry the worker's lastRunAt per bench,
// minute-grained instead of scrape-grained, which is honest and far
// better than nothing. Prom keeps priority when reachable (local
// dev, worker context).
if (Object.keys(freshness).length === 0) {
try {
const { loadAllBenchmarks } = await import("@/lib/spec");
const all = await loadAllBenchmarks();
for (const b of all) {
if (!liveSlugSet.has(b.slug)) continue;
const t = Date.parse(b.lastRunAt ?? "");
if (Number.isFinite(t)) freshness[b.slug] = t;
}
} catch {
// leave empty; the indicator degrades exactly as before
}
}
return { now: Date.now(), freshness };
},
["freshness-v2"],
["freshness-v3"],
{ revalidate: 30, tags: ["benchmarks", "freshness"] },
);

Expand Down
15 changes: 9 additions & 6 deletions src/app/compare/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,15 @@ export async function generateMetadata({
const liveSharedCount = sharedSlugsForMeta.filter(
(s) => !excluded.has(s) && aLive.has(s) && bLive.has(s),
).length;
// Curated pairs (explicit benchmarks list in COMPARE_PAIRS) are
// hand-picked head-term targets like usdc-vs-usdt and carry editorial
// framing beyond the ledger, so they stay indexable even with a
// single live shared bench. The gate only applies to combinatorial
// ad hoc pairs.
const isCurated = !!pair.benchmarks;
// Curated pairs are hand-picked head-term targets like usdc-vs-usdt
// and carry editorial framing beyond the ledger, so they stay
// indexable even with a single live shared bench. Membership in
// COMPARE_PAIRS is the curation signal; `pair.benchmarks` is only an
// optional editorial override most curated entries do not set (the
// previous check on it noindexed usdc-vs-usdt and
// dydx-vs-hyperliquid in prod). The gate only applies to
// combinatorial ad hoc pairs.
const isCurated = getComparePair(pair.slug) !== undefined;
const thin = !isCurated && liveSharedCount < 2;

// Meta description: unique per pair via the shared-count + provider
Expand Down
Loading