Jet\Debug_Profiler

Main class - the facade of the entire subsystem.

It performs profiler initialization and is the class whose methods should be used by the developer to create runtime blocks and messages.

Method Overview

Method Importance
public static enable(
bool $log_SQL_queries,
callable $saver,
?callable $displayer = null,
): void
Enables profiler. In practice, it is used by the _profiler microapplication controller.

Parameters:
  • $log_SQL_queries: should log SQL queries?
  • $saver: callback that stores runtime information (e.g.
    Function prototype: function(Debug_Profiler_Run
                        $run
    ) : void
  • displayer: callback that takes care of some display of the output after the run is finished. For example, a status bar.
    Function prototype: function(Debug_Profiler_Run $run) :
                            
    void
public static disable(
): void
Turns off profiler
public static enabled(
): bool
Indicates whether or not the profiler is enabled
public static getLogSQLQueries(
): bool
Indicates whether or not the profiler has permission to log SQL queries
public static getRun(): Debug_Profiler_Run|null Returns run information (see Jet\Debug_Profiler_Run).
public static SQLQueryStart(
string $query,
array $query_params = []
): void
This method is called before the execution of the SQL query begins.

This method is used by the Jet platform. But if necessary, it can also be used by the application developer, e.g., in situations where SQL queries are executed completely outside of Jet (e.g., by an independent query engine)
public static SQLQueryDone(
int $rows_count = 0
): void
This method is called after the SQL query is executed.

This method is used by the Jet platform. But if necessary, it can also be used by the application developer, e.g., in situations where SQL queries are executed completely outside of Jet (e.g., by an independent khihov)
public static message(
string $text
): void
Creates a debug message within the current run block.
public static blockStart(
string $label
): void
Starts (opens) a run block.
public static blockEnd(
string $label
): void
Ends (closes) the run block.
Previous chapter
How the profiler works (in depth)
Next chapter
Jet\Debug_Profiler_Run