import type { Metadata } from 'next'; import { Columns } from '@/components/charts/bars'; import { Dot, LiveAgo } from '@/components/ui/live'; import { Container, Note, PageHeader, Stat, StatGrid, Unavailable } from '@/components/ui/section'; import { api, safe } from '@/lib/api'; import { fmtBytes, fmtDate, fmtDays, fmtInt, fmtPct } from '@/lib/format'; export const metadata: Metadata = { title: 'System status', description: 'Public aggregate health of the Company Atlas sensor network: sensors online, observations and events today, success rate and scheduler lag.' }; export const revalidate = 30; export default async function SystemPage() { const [sys, stats, hist] = await Promise.all([safe(api.system()), safe(api.stats()), safe(api.statsHistory(30))]); const ok = sys && (sys.success_rate_24h ?? 100) >= 90 && (sys.queue_lag_s ?? 0) < 600; return ( System } title={sys ? (ok ? 'All systems observing' : 'Degraded — observing with reduced throughput') : 'Status unavailable'} lede="Aggregate health only (spec §130): no per-sensor or per-domain detail is published here. Individual sensor freshness is shown on each company’s Sources tab." /> {!sys ? ( ) : ( )} {sys && (

Scheduler last tick · this page refreshes every 30 s on the server.

)} {stats && (

Dataset

)} {hist && hist.items.length > 1 && (
{( [ ['observations', 'Observations / day'], ['changes', 'Changes / day'], ['events', 'Events / day'], ] as const ).map(([k, label]) => (

{label} · 30 d

h[k])} width={300} height={48} className="mt-2 h-auto w-full" ariaLabel={label} />

latest {fmtInt(hist.items[hist.items.length - 1]?.[k])}

))}
)} Each service exposes /health, /ready and /metrics internally; this page summarises them. “Last successfully checked” timestamps on company pages are the honest freshness signal for any single fact.
); }