Openstatus www.openstatus.dev

๐Ÿ› test checker (#1008)

* ๐Ÿ› test checker

* ci: apply automated fixes

* fix: ts

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Kaske <maximilian@kaske.org>

authored by

Thibault Le Ouay
autofix-ci[bot]
Maximilian Kaske
and committed by
GitHub
05c141f6 11a0d524

+48 -46
+3 -1
apps/web/src/app/api/og/checker/route.tsx
··· 70 70 {data?.url} 71 71 </h2> 72 72 {data && ( 73 - <p tw="text-slate-500 text-right">{timestampFormatter(data.time)}</p> 73 + <p tw="text-slate-500 text-right"> 74 + {timestampFormatter(data.timestamp)} 75 + </p> 74 76 )} 75 77 <div tw="flex"> 76 78 <div tw="flex flex-col flex-1">
+1 -1
apps/web/src/app/play/checker/[id]/page.tsx
··· 62 62 {data.url} 63 63 </h1> 64 64 <p className="text-muted-foreground text-sm sm:text-base"> 65 - {timestampFormatter(data.time)} 65 + {timestampFormatter(data.timestamp)} 66 66 </p> 67 67 </div> 68 68 <div>
+36 -36
apps/web/src/app/play/checker/api/mock.ts
··· 16 16 17 17 export const data = { 18 18 url: "https://openstatus.dev", 19 - time: 1724415466600, 19 + timestamp: 1724415466600, 20 20 method: "GET", 21 21 checks: [ 22 22 { ··· 39 39 "X-Vercel-Cache": "MISS", 40 40 "X-Vercel-Id": "fra1::fra1::82mqm-1724415466843-d608bd28fa1c", 41 41 }, 42 - time: 1724415466739, 42 + timestamp: 1724415466739, 43 43 timing: { 44 44 dnsStart: 1724415466810, 45 45 dnsDone: 1724415466812, ··· 75 75 "X-Vercel-Execution-Region": "fra1", 76 76 "X-Vercel-Id": "arn1::fra1::9855t-1724415466874-b441298d1373", 77 77 }, 78 - time: 1724415466771, 78 + timestamp: 1724415466771, 79 79 timing: { 80 80 dnsStart: 1724415466822, 81 81 dnsDone: 1724415466839, ··· 111 111 "X-Vercel-Execution-Region": "fra1", 112 112 "X-Vercel-Id": "iad1::fra1::knlx7-1724415466923-6d8a2defb96b", 113 113 }, 114 - time: 1724415466780, 114 + timestamp: 1724415466780, 115 115 timing: { 116 116 dnsStart: 1724415466872, 117 117 dnsDone: 1724415466874, ··· 147 147 "X-Vercel-Execution-Region": "fra1", 148 148 "X-Vercel-Id": "iad1::fra1::zv2ml-1724415467303-bd78546dd164", 149 149 }, 150 - time: 1724415466805, 150 + timestamp: 1724415466805, 151 151 timing: { 152 152 dnsStart: 1724415467056, 153 153 dnsDone: 1724415467130, ··· 183 183 "X-Vercel-Execution-Region": "fra1", 184 184 "X-Vercel-Id": "bom1::fra1::24p8d-1724415467151-89ab94155a7b", 185 185 }, 186 - time: 1724415466933, 186 + timestamp: 1724415466933, 187 187 timing: { 188 188 dnsStart: 1724415467117, 189 189 dnsDone: 1724415467144, ··· 219 219 "X-Vercel-Execution-Region": "fra1", 220 220 "X-Vercel-Id": "iad1::fra1::89mxf-1724415466920-c57e2b6af701", 221 221 }, 222 - time: 1724415466802, 222 + timestamp: 1724415466802, 223 223 timing: { 224 224 dnsStart: 1724415466872, 225 225 dnsDone: 1724415466885, ··· 255 255 "X-Vercel-Execution-Region": "fra1", 256 256 "X-Vercel-Id": "cdg1::fra1::g7g65-1724415467776-ef2e03e01f49", 257 257 }, 258 - time: 1724415467743, 258 + timestamp: 1724415467743, 259 259 timing: { 260 260 dnsStart: 1724415467766, 261 261 dnsDone: 1724415467769, ··· 291 291 "X-Vercel-Execution-Region": "fra1", 292 292 "X-Vercel-Id": "sfo1::fra1::k8shj-1724415468145-cc12e589b9ec", 293 293 }, 294 - time: 1724415467973, 294 + timestamp: 1724415467973, 295 295 timing: { 296 296 dnsStart: 1724415468074, 297 297 dnsDone: 1724415468075, ··· 327 327 "X-Vercel-Execution-Region": "fra1", 328 328 "X-Vercel-Id": "cle1::fra1::sxq92-1724415468662-2cd7c277d058", 329 329 }, 330 - time: 1724415468380, 330 + timestamp: 1724415468380, 331 331 timing: { 332 332 dnsStart: 1724415468552, 333 333 dnsDone: 1724415468554, ··· 363 363 "X-Vercel-Execution-Region": "fra1", 364 364 "X-Vercel-Id": "iad1::fra1::8dpsb-1724415468744-2a4aa1e3d5ab", 365 365 }, 366 - time: 1724415468672, 366 + timestamp: 1724415468672, 367 367 timing: { 368 368 dnsStart: 1724415468716, 369 369 dnsDone: 1724415468721, ··· 399 399 "X-Vercel-Execution-Region": "fra1", 400 400 "X-Vercel-Id": "gru1::fra1::g8pl7-1724415469119-c65e63554739", 401 401 }, 402 - time: 1724415468749, 402 + timestamp: 1724415468749, 403 403 timing: { 404 404 dnsStart: 1724415468984, 405 405 dnsDone: 1724415469043, ··· 434 434 "X-Vercel-Cache": "MISS", 435 435 "X-Vercel-Id": "fra1::fra1::kv28h-1724415468785-c9192137c9ed", 436 436 }, 437 - time: 1724415468739, 437 + timestamp: 1724415468739, 438 438 timing: { 439 439 dnsStart: 1724415468775, 440 440 dnsDone: 1724415468779, ··· 470 470 "X-Vercel-Execution-Region": "fra1", 471 471 "X-Vercel-Id": "sfo1::fra1::jn45p-1724415470146-7160122c2733", 472 472 }, 473 - time: 1724415469619, 473 + timestamp: 1724415469619, 474 474 timing: { 475 475 dnsStart: 1724415469889, 476 476 dnsDone: 1724415469947, ··· 506 506 "X-Vercel-Execution-Region": "fra1", 507 507 "X-Vercel-Id": "gru1::fra1::df9rf-1724415469769-16109f11a918", 508 508 }, 509 - time: 1724415469592, 509 + timestamp: 1724415469592, 510 510 timing: { 511 511 dnsStart: 1724415469639, 512 512 dnsDone: 1724415469748, ··· 542 542 "X-Vercel-Execution-Region": "fra1", 543 543 "X-Vercel-Id": "gru1::fra1::ps6s8-1724415469878-6e2b2b9481e6", 544 544 }, 545 - time: 1724415469642, 545 + timestamp: 1724415469642, 546 546 timing: { 547 547 dnsStart: 1724415469762, 548 548 dnsDone: 1724415469871, ··· 578 578 "X-Vercel-Execution-Region": "fra1", 579 579 "X-Vercel-Id": "hkg1::fra1::fxvwk-1724415469898-52ddb6281608", 580 580 }, 581 - time: 1724415469801, 581 + timestamp: 1724415469801, 582 582 timing: { 583 583 dnsStart: 1724415469859, 584 584 dnsDone: 1724415469892, ··· 614 614 "X-Vercel-Execution-Region": "fra1", 615 615 "X-Vercel-Id": "iad1::fra1::lpxzz-1724415470208-6564146436d5", 616 616 }, 617 - time: 1724415470173, 617 + timestamp: 1724415470173, 618 618 timing: { 619 619 dnsStart: 1724415470193, 620 620 dnsDone: 1724415470196, ··· 650 650 "X-Vercel-Execution-Region": "fra1", 651 651 "X-Vercel-Id": "cpt1::fra1::lnlth-1724415471275-cf922a128799", 652 652 }, 653 - time: 1724415470963, 653 + timestamp: 1724415470963, 654 654 timing: { 655 655 dnsStart: 1724415471216, 656 656 dnsDone: 1724415471218, ··· 686 686 "X-Vercel-Execution-Region": "fra1", 687 687 "X-Vercel-Id": "sfo1::fra1::tpm8t-1724415471358-ec064b0eab3d", 688 688 }, 689 - time: 1724415471269, 689 + timestamp: 1724415471269, 690 690 timing: { 691 691 dnsStart: 1724415471325, 692 692 dnsDone: 1724415471327, ··· 722 722 "X-Vercel-Execution-Region": "fra1", 723 723 "X-Vercel-Id": "lhr1::fra1::7lf7n-1724415471374-7ef5cab51600", 724 724 }, 725 - time: 1724415471324, 725 + timestamp: 1724415471324, 726 726 timing: { 727 727 dnsStart: 1724415471360, 728 728 dnsDone: 1724415471366, ··· 758 758 "X-Vercel-Execution-Region": "fra1", 759 759 "X-Vercel-Id": "cdg1::fra1::jszwl-1724415471627-5821aab52b06", 760 760 }, 761 - time: 1724415471373, 761 + timestamp: 1724415471373, 762 762 timing: { 763 763 dnsStart: 1724415471554, 764 764 dnsDone: 1724415471556, ··· 794 794 "X-Vercel-Execution-Region": "fra1", 795 795 "X-Vercel-Id": "iad1::fra1::jscbc-1724415472309-b6db76af787c", 796 796 }, 797 - time: 1724415472154, 797 + timestamp: 1724415472154, 798 798 timing: { 799 799 dnsStart: 1724415472239, 800 800 dnsDone: 1724415472240, ··· 830 830 "X-Vercel-Execution-Region": "fra1", 831 831 "X-Vercel-Id": "hnd1::fra1::kxkwr-1724415472423-82ba874bb590", 832 832 }, 833 - time: 1724415472357, 833 + timestamp: 1724415472357, 834 834 timing: { 835 835 dnsStart: 1724415472405, 836 836 dnsDone: 1724415472410, ··· 866 866 "X-Vercel-Execution-Region": "fra1", 867 867 "X-Vercel-Id": "cle1::fra1::8zclb-1724415472414-c402d33465fc", 868 868 }, 869 - time: 1724415472323, 869 + timestamp: 1724415472323, 870 870 timing: { 871 871 dnsStart: 1724415472378, 872 872 dnsDone: 1724415472380, ··· 901 901 "X-Vercel-Cache": "MISS", 902 902 "X-Vercel-Id": "fra1::fra1::tjkng-1724415472738-a6c3d672835c", 903 903 }, 904 - time: 1724415472487, 904 + timestamp: 1724415472487, 905 905 timing: { 906 906 dnsStart: 1724415472627, 907 907 dnsDone: 1724415472658, ··· 937 937 "X-Vercel-Execution-Region": "fra1", 938 938 "X-Vercel-Id": "sfo1::fra1::jn45p-1724415473337-466a2679cdf6", 939 939 }, 940 - time: 1724415472895, 940 + timestamp: 1724415472895, 941 941 timing: { 942 942 dnsStart: 1724415473151, 943 943 dnsDone: 1724415473169, ··· 973 973 "X-Vercel-Execution-Region": "fra1", 974 974 "X-Vercel-Id": "sfo1::fra1::cfhm9-1724415474388-d835d118b121", 975 975 }, 976 - time: 1724415473741, 976 + timestamp: 1724415473741, 977 977 timing: { 978 978 dnsStart: 1724415474074, 979 979 dnsDone: 1724415474203, ··· 1009 1009 "X-Vercel-Execution-Region": "fra1", 1010 1010 "X-Vercel-Id": "gru1::fra1::dtczd-1724415474697-bc49fc211c26", 1011 1011 }, 1012 - time: 1724415474183, 1012 + timestamp: 1724415474183, 1013 1013 timing: { 1014 1014 dnsStart: 1724415474470, 1015 1015 dnsDone: 1724415474578, ··· 1045 1045 "X-Vercel-Execution-Region": "fra1", 1046 1046 "X-Vercel-Id": "sfo1::fra1::wwf2m-1724415474188-b0c6f71df2db", 1047 1047 }, 1048 - time: 1724415474161, 1048 + timestamp: 1724415474161, 1049 1049 timing: { 1050 1050 dnsStart: 1724415474177, 1051 1051 dnsDone: 1724415474180, ··· 1081 1081 "X-Vercel-Execution-Region": "fra1", 1082 1082 "X-Vercel-Id": "pdx1::fra1::fdxft-1724415474318-e900cbf850a7", 1083 1083 }, 1084 - time: 1724415474239, 1084 + timestamp: 1724415474239, 1085 1085 timing: { 1086 1086 dnsStart: 1724415474291, 1087 1087 dnsDone: 1724415474294, ··· 1117 1117 "X-Vercel-Execution-Region": "fra1", 1118 1118 "X-Vercel-Id": "sin1::fra1::b8msv-1724415474849-b7ad6db342b4", 1119 1119 }, 1120 - time: 1724415474736, 1120 + timestamp: 1724415474736, 1121 1121 timing: { 1122 1122 dnsStart: 1724415474838, 1123 1123 dnsDone: 1724415474840, ··· 1153 1153 "X-Vercel-Execution-Region": "fra1", 1154 1154 "X-Vercel-Id": "syd1::fra1::p48zw-1724415475067-dce86bb55ee4", 1155 1155 }, 1156 - time: 1724415475023, 1156 + timestamp: 1724415475023, 1157 1157 timing: { 1158 1158 dnsStart: 1724415475058, 1159 1159 dnsDone: 1724415475059, ··· 1188 1188 "X-Vercel-Cache": "MISS", 1189 1189 "X-Vercel-Id": "fra1::fra1::dlk76-1724415475594-7c5b9c827a3d", 1190 1190 }, 1191 - time: 1724415475389, 1191 + timestamp: 1724415475389, 1192 1192 timing: { 1193 1193 dnsStart: 1724415475504, 1194 1194 dnsDone: 1724415475527, ··· 1224 1224 "X-Vercel-Execution-Region": "fra1", 1225 1225 "X-Vercel-Id": "iad1::fra1::dc8tg-1724415476028-5d259d762ec1", 1226 1226 }, 1227 - time: 1724415475892, 1227 + timestamp: 1724415475892, 1228 1228 timing: { 1229 1229 dnsStart: 1724415475952, 1230 1230 dnsDone: 1724415475978, ··· 1260 1260 "X-Vercel-Execution-Region": "fra1", 1261 1261 "X-Vercel-Id": "cle1::fra1::bckhc-1724415476215-f3c71058df41", 1262 1262 }, 1263 - time: 1724415476081, 1263 + timestamp: 1724415476081, 1264 1264 timing: { 1265 1265 dnsStart: 1724415476155, 1266 1266 dnsDone: 1724415476157,
+1 -1
apps/web/src/components/monitor-dashboard/response-details.tsx
··· 34 34 latency: response.latency || 0, 35 35 region: response.region, 36 36 status: response.statusCode || 0, 37 - time: response.cronTimestamp || 0, 37 + timestamp: response.cronTimestamp || 0, 38 38 }} 39 39 /> 40 40 <Tabs defaultValue={defaultValue}>
+2 -2
apps/web/src/components/ping-response-analysis/region-info.tsx
··· 6 6 check, 7 7 error, 8 8 }: { 9 - check: Pick<RegionChecker, "region" | "time" | "latency" | "status">; 9 + check: Pick<RegionChecker, "region" | "timestamp" | "latency" | "status">; 10 10 error?: string; 11 11 }) { 12 12 return ( ··· 15 15 <p className="text-muted-foreground">Time:</p> 16 16 </div> 17 17 <div className="col-span-3 sm:col-span-6"> 18 - <p>{timestampFormatter(check.time)}</p> 18 + <p>{timestampFormatter(check.timestamp)}</p> 19 19 </div> 20 20 <div className="col-span-2"> 21 21 <p className="text-muted-foreground">Region:</p>
+5 -5
apps/web/src/components/ping-response-analysis/utils.ts
··· 103 103 status: z.number(), 104 104 latency: z.number(), 105 105 headers: z.record(z.string()), 106 - time: z.number(), 106 + timestamp: z.number(), 107 107 timing: timingSchema, 108 108 body: z.string().optional().nullable(), 109 109 }); 110 110 111 111 export const cachedCheckerSchema = z.object({ 112 112 url: z.string(), 113 - time: z.number(), 113 + timestamp: z.number(), 114 114 method: z.enum(["GET", "POST", "PUT", "DELETE"]).default("GET"), 115 115 checks: checkerSchema.extend({ region: monitorFlyRegionSchema }).array(), 116 116 }); ··· 202 202 id: string; 203 203 }) { 204 204 const redis = Redis.fromEnv(); 205 - const time = new Date().getTime(); 206 - const cache = { url, method, time }; 205 + const timestamp = new Date().getTime(); 206 + const cache = { url, method, timestamp }; 207 207 208 208 const parsed = cachedCheckerSchema 209 - .pick({ url: true, method: true, time: true }) 209 + .pick({ url: true, method: true, timestamp: true }) 210 210 .safeParse(cache); 211 211 212 212 if (!parsed.success) {