The GitHub Actions job "CI" on grails-core.git/feat/sql-tail-command has failed.
Run started by GitHub user jdaugherty (triggered by jdaugherty).

Head commit for run:
918443372ec673d449e0cd9c99c969f559109fde / James Daugherty 
<[email protected]>
Add the sql-tail command to find query-heavy pages

A page that is slow because it runs hundreds of queries is easy to miss in
a log: logSql prints every statement, but not which page ran it or how many
a request added up to. The new sql-tail command shows the pages of a
running application ranked by the statements they run per request, and for
each page the statement that repeats most within one request, which is what
an N+1 looks like.

Capture is off unless the application is started with it, so an application
started without the flag carries no statement inspector:

    grails run-app --sql-tail      # or ./gradlew bootRun 
-Pgrails.gorm.sqlTail.enabled
    grails sql-tail                # in a second terminal

The Hibernate 5 and Hibernate 7 connection source factories read
grails.gorm.sqlTail.enabled and install SqlTailStatementInspector on the
session factory, wrapping any inspector the application configured. The
inspector records each statement, with the data source name, to a capture
file under the build directory, truncated per run. Attribution runs on the
request thread: the controller, action and namespace Grails resolved for
the request, the request path, and an id shared by every statement of one
request, so interceptors, the action and GSP rendering count for the same
page; work on other threads is shown under the thread name. The writer,
record format and settings live in grails-datamapping-core, with Spring Web
compile-only and guarded.

The command itself is a script command in a new grails-datamapping-core-cli
companion, so the grails shell runs it without booting the application. It
follows the capture like tail -f, resets when the application restarts and
truncates the file, and renders the page table, a statement ranking
(--statements, --page=controller/action), a per-request stream (--stream),
or a one-shot report (--all --once). Statements are collapsed to their
identifying clauses so the same query counts as one wherever it runs.

run-app gains the --sql-tail flag, and the Grails Gradle plugin hands
-Pgrails.gorm.sqlTail.* properties to forked application and test JVMs
through a GrailsPropertyArgumentProvider that the startup progress
forwarding now shares.

Report URL: https://github.com/apache/grails-core/actions/runs/38374015154

With regards,
GitHub Actions via GitBox

Reply via email to