Three copies of the same route-grouping + percentile stats logic existed in: - web getRequestStats (request-logger.ts) - web GET /api/perf (perf/route.ts inline) - CLI ao perf routes (perf.ts inline) Also, RequestLog in web was a duplicate of ApiLogEntry in core. Changes: - Add computeApiStats(), RouteStats, ApiPerfResult to packages/core/src/log-reader.ts - Export from @composio/ao-core - Rewrite web/request-logger.ts as thin delegation: re-export types from core, getRequestStats() = parseApiLogs() + computeApiStats() - Simplify web/perf/route.ts to use getRequestStats() (removes 80-line inline loop) - Update CLI perf.ts to use computeApiStats() (removes inline grouping) - Update with-timing.ts to use ApiLogEntry instead of local RequestLog - Add parseApiLogs + computeApiStats tests to core log-reader.test.ts - Simplify web request-logger.test.ts to a 3-test delegation contract - Update observability-routes.test.ts mock to include parseApiLogs/computeApiStats - Update perf.test.ts mock to include computeApiStats with inline implementation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| e2e | ||
| screenshots | ||
| server | ||
| src | ||
| .env.local.example | ||
| .gitignore | ||
| next-env.d.ts | ||
| next.config.js | ||
| package.json | ||
| postcss.config.mjs | ||
| tsconfig.json | ||
| vitest.config.ts | ||