Skip to main content
The FQL\Query\Debugger class provides CLI output utilities for inspecting queries, measuring execution time, and benchmarking iteration performance.
Debugger requires the tracy/tracy package. Install it as a dev dependency:

Starting and stopping

Call Debugger::start() at the beginning of your script. It records the start timestamp and prints an initial memory snapshot. Call Debugger::end() when you are done to print final timing and memory totals.

Inspecting a query

Debugger::inspectQuery() executes a query and prints the SQL representation, result count, memory size, and optionally all rows.

Inspecting a raw SQL string

Debugger::inspectStreamSql() parses a raw FQL string against an existing stream and shows what the applied query looks like compared to the original input.
Use Debugger::inspectSql() when you want to parse a self-contained FQL string (with format and path embedded) and have the Query object returned:

Benchmarking a query

Debugger::benchmarkQuery() runs a query in both stream and in-memory modes for the specified number of iterations, then prints throughput stats.
The default number of iterations is 2500.

Dumping a value

Debugger::dump() delegates to Tracy’s dump() function for pretty-printing any PHP value:

Example output

Running composer example:csv produces output similar to this:
Notice the large difference in iteration time between STREAM BENCHMARK (re-reads the file each time) and IN_MEMORY BENCHMARK (iterates a cached result set). Use in-memory results when you need to iterate over the same data multiple times.

Method reference