FQL\Query\Debugger class provides CLI output utilities for inspecting queries, measuring execution time, and benchmarking iteration performance.
Starting and stopping
CallDebugger::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.
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.
2500.
Dumping a value
Debugger::dump() delegates to Tracy’s dump() function for pretty-printing any PHP value:
Example output
Runningcomposer example:csv produces output similar to this:
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
| Method | Description |
|---|---|
Debugger::start() | Record start time and print initial memory stats |
Debugger::end() | Print final elapsed time and memory totals |
Debugger::inspectQuery($query, $listResults) | Execute query and print SQL, count, memory, and rows |
Debugger::inspectStreamSql($stream, $sql) | Parse FQL against a stream and show applied SQL diff |
Debugger::inspectSql($sql) | Parse a self-contained FQL string and return the Query |
Debugger::benchmarkQuery($query, $iterations) | Run N iterations in both stream and in-memory modes |
Debugger::dump($value) | Pretty-print a PHP value via Tracy |
Debugger::split() | Print elapsed time since the last split point |