← back to Yolo Agent Tasks Staging

05_wallco_brief_stats.md

21 lines

Work on ~/Projects/wallco-ai. /brief has ETag short-circuit. Add hit counter parallel to /compare's.

TASK: Brief-ETag stats.

Add `const _briefStats = { hits: 0, misses: 0, since: Date.now() };` next to the other stats vars.

In the /brief route handler:
- After computing _briefEtag and BEFORE the `if (req.headers['if-none-match'] === _briefEtag) return res.status(304).end();` line, change that line to:
  ```js
  if (req.headers['if-none-match'] === _briefEtag) { _briefStats.hits++; return res.status(304).end(); }
  _briefStats.misses++;
  ```

In /admin/health, add a `brief_etag` block parallel to compare_etag.

Smoke: fire /brief?ids=14,72&project=Test twice with INM on the 2nd, then check /admin/health.

Commit: `/admin/health: brief-ETag hit/miss stats (parallel to compare/random/by-color)`

Reload via pm2.