Changeset 2981933
- Timestamp:
- 10/21/2023 06:55:26 AM (2 years ago)
- Location:
- mysql-query-cache-stats
- Files:
-
- 6 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (modified) (previous)
-
trunk/mysql-query-cache-stats.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/widget.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mysql-query-cache-stats/trunk/mysql-query-cache-stats.php
r2403329 r2981933 6 6 Plugin URI: https://wordpress.org/plugins/mysql-query-cache-stats 7 7 Author URI: https://profiles.wordpress.org/morisdov 8 Version: 1.0. 38 Version: 1.0.4 9 9 10 10 */ … … 38 38 return; 39 39 } 40 global $wpdb; 41 $wpdb->show_errors(true); 42 $start_time = microtime(true); 43 $sql = "SELECT * FROM " . $wpdb->prefix . "options WHERE autoload='yes' "; 44 $result = $wpdb->get_results($sql, ARRAY_A); 45 $end_time = microtime(true); 46 $wpdb->show_errors(false); 47 48 $execution_time = ($end_time - $start_time) * 1000; // Convert to milliseconds 49 //$execution_time = number_format($execution_time, 1); // Format to 1 decimal place 50 $execution_time = number_format($execution_time); // Format to 0 decimal place 51 //error_log("Query took " . $execution_time . " milliseconds to execute"); 52 40 53 $myArr = []; 41 global $wpdb; 54 $myArr['Options Autoload Query Time'] = $execution_time . ' ms'; 55 42 56 $sql = "SELECT 'Options Autoload Size', (SUM(LENGTH(option_name)) + SUM(LENGTH(option_value)) + (count(option_name)*32)) 43 57 AS 'value' FROM " . $wpdb->prefix . "options WHERE autoload='yes' … … 63 77 } 64 78 } 65 $myOrder = array('Questions','Qcache_hits','Query_cache_type','Database Size','Query_cache_size','Qcache_free_memory','Query_cache_limit','Options Autoload Size', 79 $myOrder = array('Questions','Qcache_hits','Query_cache_type','Database Size','Query_cache_size','Qcache_free_memory','Query_cache_limit','Options Autoload Size','Options Autoload Query Time', 66 80 'Qcache_lowmem_prunes','Qcache_inserts','Qcache_queries_in_cache','Qcache_not_cached','Qcache_total_blocks'); 67 81 $tmp = []; -
mysql-query-cache-stats/trunk/readme.txt
r2963259 r2981933 30 30 31 31 == Changelog == 32 = 1.0.4 = 33 * Added wp_options Autoload Query Time 32 34 = 1.0.3 = 33 35 * Added wp_options Autoload Size -
mysql-query-cache-stats/trunk/widget.css
r2403329 r2981933 5 5 text-align: right; 6 6 } 7 .md_qcache_table tr:nth-child(3), .md_qcache_table tr:nth-child( 8), .md_qcache_table tr:last-child {7 .md_qcache_table tr:nth-child(3), .md_qcache_table tr:nth-child(9), .md_qcache_table tr:last-child { 8 8 box-shadow: 0 1px 0 rgba(0,0,0,.08); 9 9 }
Note: See TracChangeset
for help on using the changeset viewer.