Developer Jamie Schouten created a neat Laravel Pulse card to monitor your database status by providing key metrics like active threads, connections, and more:
This card configuration supports configuring multiple databases, and you can configure which types of data to include:
<?php
use \Maantje\Pulse\Database\Recorders\DatabaseRecorder;
return [
'recorders' => [
DatabaseRecorder::class => [
'connections' => [
'mysql' => [
'values' => [
'Connections',
'Threads_connected',
'Threads_running',
'Innodb_buffer_pool_reads',
'Innodb_buffer_pool_read_requests',
'Innodb_buffer_pool_pages_total',
'Max_used_connections'
],
'aggregates' => [
'avg' => [
'Threads_connected',
'Threads_running',
'Innodb_buffer_pool_reads',
'Innodb_buffer_pool_read_requests',
'Innodb_buffer_pool_pages_total',
],
'max' => []
// ...
],
],
]
],
]
]
Here's an example component for getting active threads for your databases:
<livewire:database cols='6' title="Active threads" :values="['Threads_connected', 'Threads_running']" :graphs="[
'avg' => ['Threads_connected' => '#ffffff', 'Threads_running' => '#3c5dff'],
]" />
The above component will render something like the following:
You can learn more about this package, get full installation instructions, and view the source code on GitHub.