Get expert guidance in a few days with a Laravel code review

Pulse Database

maantje/pulse-database image

Pulse Database stats

Downloads
26
Stars
7
Open Issues
1
Forks
1

View on GitHub →

A Laravel Pulse card for database status

Database status card for Laravel Pulse

Get real-time insights into the status of your database

Example

Installation

Install the package using Composer:

composer require maantje/pulse-database

Register the recorder

In your pulse.php configuration file, register the DatabaseRecorder with the desired settings:

return [
// ...
 
'recorders' => [
\Maantje\Pulse\Database\Recorders\DatabaseRecorder::class => [
'connections' => [
'mysql_another' => [
'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' => [
//
],
'count' => [
//
],
],
],
'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' => [
//
],
'count' => [
//
],
],
]
]
],
]
]

Ensure you're running the pulse:check command.

Add to your dashboard

Integrate the card into your Pulse dashboard by publish the vendor view. and then modifying the dashboard.blade.php file:

<x-pulse>
<livewire:pulse.servers cols="full" />
 
+ <livewire:database cols='6' title="Active threads" :values="['Threads_connected', 'Threads_running']" :graphs="[
+ 'avg' => ['Threads_connected' => '#ffffff', 'Threads_running' => '#3c5dff'],
+ ]" />
 
+ <livewire:database cols='6' title="Connections" :values="['Connections', 'Max_used_connections']" />
 
+ <livewire:database cols='full' title="Innodb" :values="['Innodb_buffer_pool_reads', 'Innodb_buffer_pool_read_requests', 'Innodb_buffer_pool_pages_total']" :graphs="[
+ 'avg' => ['Innodb_buffer_pool_reads' => '#ffffff', 'Innodb_buffer_pool_read_requests' => '#3c5dff'],
+ ]" />
 
<livewire:pulse.usage cols="4" rows="2" />
 
<livewire:pulse.queues cols="4" />
 
<livewire:pulse.cache cols="4" />
 
<livewire:pulse.slow-queries cols="8" />
 
<livewire:pulse.exceptions cols="6" />
 
<livewire:pulse.slow-requests cols="6" />
 
<livewire:pulse.slow-jobs cols="6" />
 
<livewire:pulse.slow-outgoing-requests cols="6" />
 
</x-pulse>

And that's it! Enjoy enhanced visibility into your database status on your Pulse dashboard.

maantje photo

Code enthusiast, Back-end developer @ Qlic Internet solutions, Freelance Developer.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Maantje Pulse Database Related Articles

Laracon EU Videos are now out image

Laracon EU Videos are now out

Read article
Database Status Card for Laravel Pulse image

Database Status Card for Laravel Pulse

Read article
The Certification of Competence for Laravel logo

The Certification of Competence for Laravel

A community-driven, proctored assessment across 4 levels designed to validate real-world Laravel knowledge, from Junior to mastery-level Artisan. Official Vue.js, Official Nuxt, Angular, React, JS certifications also available.

The Certification of Competence for Laravel
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media