[object Object]

← back to build-pages

smoke: /healthz <50ms perf budget (regression guard for a no-DB literal)

f727cc7044874cb0e8698688090c47e15311192e · 2026-05-13 14:25:13 -0700 · SteveStudio2

Files touched

Diff

commit f727cc7044874cb0e8698688090c47e15311192e
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Wed May 13 14:25:13 2026 -0700

    smoke: /healthz <50ms perf budget (regression guard for a no-DB literal)
---
 test/smoke.js | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/test/smoke.js b/test/smoke.js
index b0af439..e3767fb 100644
--- a/test/smoke.js
+++ b/test/smoke.js
@@ -35,13 +35,20 @@ function check(name, cond, hint = '') {
 (async () => {
   if (!process.argv.includes('--json')) console.log(`build-pages smoke — ${BASE}\n`);
 
-  // 1. healthz + HEAD
-  let r = await fetch('/healthz');
-  check('healthz: 200',            r.status === 200);
-  check('healthz: ok JSON',        /"ok":true/.test(r.body));
-  check('healthz: no-store',       (r.headers['cache-control'] || '').includes('no-store'));
-  r = await fetch('/healthz', { method: 'HEAD' });
-  check('healthz: HEAD 200',       r.status === 200);
+  // 1. healthz + HEAD + perf budget
+  // /healthz is a no-DB JSON literal; <50ms is generous, actual is ~2ms warm.
+  {
+    const t0 = Date.now();
+    let r = await fetch('/healthz');
+    const ms = Date.now() - t0;
+    check('healthz: 200',            r.status === 200);
+    check('healthz: ok JSON',        /"ok":true/.test(r.body));
+    check('healthz: no-store',       (r.headers['cache-control'] || '').includes('no-store'));
+    check('healthz: <50ms',          ms < 50, `actual ${ms}ms`);
+    r = await fetch('/healthz', { method: 'HEAD' });
+    check('healthz: HEAD 200',       r.status === 200);
+  }
+  let r;
 
   // 2. /api/health
   r = await fetch('/api/health');

← a8b4a3e seo: BreadcrumbList JSON-LD on commit detail page + 2 smoke  ·  back to build-pages  ·  commit page: diff +/- syntax highlighting (green add, red re d1c2c50 →