The database instruments measure the performance of database queries directly in the CI
The database instruments allow measuring the performance of database queries
directly in the CI. For each benchmark, information about the database queries
is displayed in the CodSpeed dashboard. The following performance issues can be
detected:
Un-optimized queries: queries that are not using indexes or are not using
them efficiently
N+1 queries: queries that are executed multiple times for each item in a
list instead of using a single query (coming soon)
Example of a benchmark with an un-optimized MongoDB query
The following benefits can be expected from using the database instruments:
Full visibility on the performance of your database queries, directly in the
CI
Detect and fix problematic queries before they are deployed to production
When enabled, the CodSpeed Action will automatically spawn a proxy server that
will intercept all database queries. Each query will be executed against a real
database and the response sent back to the application.For each query, the CodSpeed proxy will communicate with the real database to
gather the explain plan and other metrics about it. When the run is
finished, the data is sent to CodSpeed where it is processed.