pulse stop

This commit is contained in:
Marcelo
2026-05-01 06:19:30 +00:00
parent 864be8d932
commit 4299ef3478
5 changed files with 124 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ import { requireSession } from "@/lib/auth/requireSession";
import {
fetchLatestHeartbeats,
fetchLatestKpis,
fetchLatestMacrostops,
fetchMachineBase,
mergeMachineOverviewRows,
} from "@/lib/machines/withLatest";
@@ -58,6 +59,10 @@ export async function GET(req: Request) {
if (perfEnabled) timings.kpiQuery = elapsedMs(kpiStart);
}
const macrostopStart = nowMs();
const macrostops = await fetchLatestMacrostops(session.orgId, machineIds);
if (perfEnabled) timings.macrostopsQuery = elapsedMs(macrostopStart);
const postQueryStart = nowMs();
// flatten latest heartbeat for UI convenience
@@ -65,6 +70,7 @@ export async function GET(req: Request) {
machines,
heartbeats,
kpis,
macrostops,
includeKpi,
});