Description
At shutdown produce the SAVEQUERIES reportOnly do this if SAVEQUERIES is defined Note: If SAVEQUERIES was not defined in wp-config.php then we can miss the first query. The value of $wpdb->num_queries will be greater than the number of queries logged in the array. This first query is:
[0] => Array
- (
- [0] => SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
- [1] => 0.028857946395874
- [2] => require(wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), wp_not_installed, is_blog_installed, wp_load_alloptions
- )
Usage
bw_trace_saved_queries();Parameters
Returns
voidSource
File name: oik-bwtrace/includes/oik-actions.phpLines:
1 to 21 of 21
function bw_trace_saved_queries() { global $wpdb; if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES == true ) { bw_trace2( $wpdb, bw_trace_saved_queries_to_csv, false ); /* $record = PHP_EOL . "<h3>Queries</h3>" . PHP_EOL; $record .= bw_trace_get_saved_queries_bwsql(); bw_trace2( $record, "Queries: {$wpdb->num_queries} in {$wpdb->elapsed_query_time}", false ); */ // Trace to CSV format $queries = bw_trace_fetch_queries_execution_time(); bw_trace_saved_queries_to_csv( $queries ); // Order by execution time, recalculate the accumulated figure and trace again $queries = bw_trace_sort_queries_by_execution_time( $queries ); $queries = bw_trace_reaccumulate_execution_time( $queries ); bw_trace_saved_queries_to_csv( $queries, bw_trace_saved_queries_grouped_by_function ); bw_trace_saved_queries_grouped_by_function( $queries ); } }View on GitHub View on Trac
Called by
Invoked by
Calls
1 to 2 of 2
Call hooks
API Letters:
