Repository navigation
traceperf test, run --routes, MySQL index check, ORM-specific N+1 fixes - #28
Merged
Merged
Conversation
- traceperf test -- <cmd>: count calls per route during the app's own tests (Jest sandboxes included, Vitest, Mocha, node:test); baseline, markdown, JSON; the action takes test: in place of run - run --routes / --param: find Express 4/5 and Fastify GET routes - missing-index check on MySQL / MariaDB via EXPLAIN FORMAT=JSON - N+1 advice names the call in the ORM from package.json - node-redis 4 legacyMode clients tracked - fix: mysql2 3.10-3.11 pooled queries were not tracked - compat: Prisma 7, mysql2 3.11, redis callback clients, EXPLAIN on MySQL 8.4 and MariaDB 11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
traceperf test -- <test command>: counts the database and HTTP calls each route makes per request during the app's own tests (supertest, or fetch to a server the tests start). No routes to list, no synthetic load. Supports Jest (a hook into jest-runtime tracks drivers loaded into its per-file sandboxes), Vitest, Mocha andnode:test. Baselines,--markdownand--jsonwork as they do forrun; the tests' own exit code wins. The action takestest: npm testin place ofrun.run --routes/--param id=1: finds GET routes in Express 4 and 5 (nested routers included; Express 5 mount paths are recorded as routers are mounted) and Fastify (onRoute).EXPLAIN FORMAT=JSON. The index is named (MySQL requires an index name). Selectivity uses rows examined, because MySQL's default estimate forcol = valueis exactly 10%.legacyModeclients are now tracked.Bug found
mysql2 3.10–3.11 didn't track queries on pooled connections at all. In those versions
PoolConnectionextendsBaseConnection, notConnection. The fix patches the prototype that defines each method. The newmysql2@3.11compat check fails before the fix and passes after.Tests
traceperf testpasses on the batched example and catches the planted N+1.--routeson Express 4, Express 5 and Fastify, and the MySQL index check on a 20k-row table.https://claude.ai/code/session_018DeDdh4rUnNHJ7wcJrP51T