flush(); } $DB->query('SHOW GLOBAL STATUS'); $DBStats = $DB->to_array('Variable_name'); $DB->query('SHOW GLOBAL VARIABLES'); $DBVars = $DB->to_array('Variable_name'); $MemStats = $Cache->getStats(); $MemStats = $MemStats[array_keys($MemStats)[0]]; View::show_header("Service Stats"); if (check_perms('site_database_specifics')) { ?>
| Service | |
| Threads (Active) | |
| Cache: | = number_format($MemStats['threads']) ?> (= number_format($MemStats['threads'] / $MemStats['max_connections'], 1) ?>%) |
| 0.7) { echo ' class="invalid" '; } ?>>Database: | = number_format($DBStats['Threads_created']['Value']) ?> (= number_format(($DBStats['Threads_connected']['Value'] / $DBStats['Threads_created']['Value']) * 100, 1) ?>%) |
| DB peak connections: | = number_format($DBStats['Max_used_connections']['Value']) ?> (= number_format($DBStats['Max_used_connections']['Value'] / $DBVars['max_connections']['Value'], 1) ?>%) |
| Connections | |
| Cache current: | = number_format($MemStats['curr_connections']) ?> |
| Cache total: | = number_format($MemStats['total_connections']) ?> |
| Database total: | = number_format($DBStats['Connections']['Value']) ?> |
| Booted | |
| Cache: | = time_diff(time() - $MemStats['uptime']) ?> |
| Database: | = time_diff(time() - $DBStats['Uptime']['Value']) ?> |
| Special | |
| Cache Current Index: | = number_format($MemStats['curr_items']) ?> |
| Cache Total Index: | = number_format($MemStats['total_items']) ?> |
| 0.85) { echo ' class="tooltip invalid" title="Evictions begin when storage exceeds 85%" '; } ?>>Cache Storage: | = Format::get_size($MemStats['bytes']) ?> = number_format($MemStats['bytes'] / $MemStats['limit_maxbytes'], 5) ?>% |
| Cache cold moves: | = number_format($MemStats['moves_to_cold']) ?>= number_format($MemStats['moves_to_cold'] / $MemStats['uptime'], 5) ?>/s |
| Cache warm moves: | = number_format($MemStats['moves_to_warm']) ?>= number_format($MemStats['moves_to_warm'] / $MemStats['uptime'], 5) ?>/s |
| Cache moves within LRU: | = number_format($MemStats['moves_within_lru']) ?>= number_format($MemStats['moves_within_lru'] / $MemStats['uptime'], 5) ?>/s |
| Utilities | |
| Cache: | |
| $MemStats['uptime'] / 7 * 24 * 3600) { echo ' class="tooltip invalid" title="Flushing the cache on a regular basis defeats the benefits of it, look into using cache transactions, or deletes instead of global flushing where possible." '; } ?>>Total flushes: | = number_format($MemStats['cmd_flush']) ?> |
| Flush ratio: | = number_format($MemStats['cmd_flush'] / $MemStats['uptime'],5) ?>/s |
| Activity | |
| Total reads | |
| Cache: | = number_format($MemStats['cmd_get']) ?> |
| Database: | = number_format($DBStats['Com_select']['Value']) ?> |
| Total writes | |
| Cache: | = number_format($MemStats['cmd_set']) ?> |
| Database: | = number_format($DBStats['Com_insert']['Value'] + $DBStats['Com_update']['Value']) ?> |
| Get/Select (Success) | |
| >Cache: | = number_format($MemStats['get_hits']) ?> (= number_format(($MemStats['get_hits'] / $MemStats['cmd_get']) * 100, 3);?>%) |
| Database: | = number_format($DBStats['Com_select']['Value']) ?> (100.000%) |
| Set/Insert (Success) | |
| Cache: | = number_format($MemStats['cmd_set']) ?> (100.000%) |
| Database: | = number_format($DBStats['Com_insert']['Value']) ?> (100.000%) |
| >Cache increment: | = number_format($MemStats['incr_hits']) ?> (= number_format(($MemStats['incr_hits'] / ($MemStats['incr_hits'] + $MemStats['incr_misses'])) * 100, 3);?>%) |
| >Cache decrement: | = number_format($MemStats['decr_hits']) ?> (= number_format(($MemStats['decr_hits'] / ($MemStats['decr_hits'] + $MemStats['decr_misses'])) * 100, 3);?>%) |
| CAS/Update (Success) | |
| 0 && $MemStats['cas_hits'] / ($MemStats['cas_hits'] + $MemStats['cas_misses']) < 0.7) { echo ' class="tooltip invalid" title="More than 30% of the issued CAS commands were unnecessarily wasting time and resources." '; } elseif ($MemStats['cas_hits'] == 0) { echo ' class="tooltip notice" title="Disable CAS with the -C parameter and save resources since it is not used." '; } ?>>Cache: | = number_format($MemStats['cas_hits']) ?> ( 0) { echo number_format(($MemStats['cas_hits'] / ($MemStats['cas_hits'] + $MemStats['cas_misses'])) * 100, 3); } else { echo '0.000'; } ?>%) |
| Database: | = number_format($DBStats['Com_update']['Value']) ?> (100.000%) |
| Deletes (Success) | |
| Cache: | = number_format($MemStats['delete_hits']) ?> (= number_format(($MemStats['delete_hits'] / ($MemStats['delete_hits'] + $MemStats['delete_misses'])) * 100, 3);?>%) |
| Database: | = number_format($DBStats['Com_delete']['Value']) ?> (100.000%) |
| Special | |
| Expired unfetched: | = number_format($MemStats['expired_unfetched']) ?> |
| Evicted unfetched: | = number_format($MemStats['evicted_unfetched']) ?> |
| Evicted: | = number_format($MemStats['evictions']) ?> |
| Slabs moved: | = number_format($MemStats['slabs_moved']) ?> |
| $DBStats['Questions']['Value'] / 7500) { echo ' class="tooltip invalid" title="1/7500 queries is allowed to be slow to minimize performance impact." '; } ?>>Database slow: | = number_format($DBStats['Slow_queries']['Value']) ?> |
| Data read | |
| Cache: | = Format::get_size($MemStats['bytes_read']) ?> |
| Database: | = Format::get_size($DBStats['Bytes_received']['Value']) ?> |
| Data write | |
| Cache: | = Format::get_size($MemStats['bytes_written']) ?> |
| Database: | = Format::get_size($DBStats['Bytes_sent']['Value']) ?> |
| Concurrency | |
| Total reads | |
| >Cache: | = number_format($MemStats['cmd_get'] / $MemStats['uptime'],5) ?>/s |
| Database: | = number_format($DBStats['Com_select']['Value'] / $DBStats['Uptime']['Value'],5) ?>/s |
| Total writes | |
| >Cache: | = number_format($MemStats['cmd_set'] / $MemStats['uptime'],5) ?>/s |
| Database: | = number_format(($DBStats['Com_insert']['Value'] + $DBStats['Com_update']['Value']) / $DBStats['Uptime']['Value'],5) ?>/s |
| Get/Select | |
| Cache: | = number_format($MemStats['get_hits'] / $MemStats['uptime'],5) ?>/s |
| Database: | = number_format($DBStats['Com_select']['Value'] / $DBStats['Uptime']['Value'],5) ?>/s |
| Set/Insert | |
| Cache: | = number_format($MemStats['cmd_set'] / $MemStats['uptime'],5) ?>/s |
| Database: | = number_format($DBStats['Com_insert']['Value'] / $DBStats['Uptime']['Value'],5) ?>/s |
| Cache increment: | = number_format($MemStats['incr_hits'] / $MemStats['uptime'],5) ?>/s |
| Cache decrement: | = number_format($MemStats['decr_hits'] / $MemStats['uptime'],5) ?>/s |
| CAS/Updates | |
| Cache: | = number_format($MemStats['cas_hits'] / $MemStats['uptime'],5) ?>/s |
| Database: | = number_format($DBStats['Com_update']['Value'] / $DBStats['Uptime']['Value'],5) ?>/s |
| Deletes | |
| Cache: | = number_format($MemStats['delete_hits'] / $MemStats['uptime'],5) ?>/s |
| Database: | = number_format($DBStats['Com_delete']['Value'] / $DBStats['Uptime']['Value'],5) ?>/s |
| Special | |
| Expired unfetched: | = number_format($MemStats['expired_unfetched'] / $MemStats['uptime'],5) ?>/s |
| Evicted unfetched: | = number_format($MemStats['evicted_unfetched'] / $MemStats['uptime'],5) ?>/s |
| Evicted: | = number_format($MemStats['evictions'] / $MemStats['uptime'],5) ?>/s |
| Slabs moved: | = number_format($MemStats['slabs_moved'] / $MemStats['uptime'],5) ?>/s |
| Database slow: | = number_format($DBStats['Slow_queries']['Value'] / $DBStats['Uptime']['Value'],5) ?>/s |
| Data read | |
| Cache: | = Format::get_size($MemStats['bytes_read'] / $MemStats['uptime']) ?>/s |
| Database: | = Format::get_size($DBStats['Bytes_received']['Value'] / $DBStats['Uptime']['Value']) ?>/s |
| Data write | |
| Cache: | = Format::get_size($MemStats['bytes_written'] / $MemStats['uptime']) ?>/s |
| Database: | = Format::get_size($DBStats['Bytes_sent']['Value'] / $DBStats['Uptime']['Value']) ?>/s |