Openstatus www.openstatus.dev
at 4c0f4c00a38753a5d0dfd7e7b7b7706dec6f1503 41 lines 1.2 kB view raw
1import type { RouterOutputs } from "@openstatus/api"; 2import { monitorRegions } from "@openstatus/db/src/schema/constants"; 3import { startOfDay } from "date-fns"; 4 5type ResponseLog = RouterOutputs["tinybird"]["list"]["data"][number]; 6 7const today = startOfDay(new Date()); 8 9export const exampleLogs: ResponseLog[] = Array.from({ length: 10 }).map( 10 (_, i) => ({ 11 id: i.toString(), 12 type: "http", 13 url: "https://api.openstatus.dev", 14 method: "GET", 15 statusCode: 200, 16 requestStatus: "success" as const, 17 latency: 150, 18 timing: { 19 dns: 10, 20 connect: 20, 21 tls: 30, 22 ttfb: 40, 23 transfer: 50, 24 }, 25 assertions: [], 26 region: monitorRegions[i], 27 error: false, 28 timestamp: today.getTime() + i * 1000 * 60, 29 headers: { 30 "Cache-Control": 31 "private, no-cache, no-store, max-age=0, must-revalidate", 32 "Content-Type": "text/html; charset=utf-8", 33 Date: "Sun, 28 Jan 2024 08:50:13 GMT", 34 Server: "Vercel", 35 }, 36 workspaceId: "1", 37 monitorId: "1", 38 cronTimestamp: today.getTime() + i * 1000 * 60, 39 trigger: "cron" as const satisfies "cron" | "api", 40 }), 41);