HealthCheck::Diagnostic::DBHPing - Ping a database handle to check its health
version v1.2.3
my $health_check = HealthCheck->new( checks => [ HealthCheck::Diagnostic::DBHPing->new( dbh => \&connect_to_db ) ] ); my $result = $health_check->check; $result->{status}; # OK on a successful ping or CRITICAL otherwise
Determines if the database connection is available. Sets the status to "OK" or "CRITICAL" based on the return value from dbh->ping.
status
dbh->ping
Those inherited from "ATTRIBUTES" in HealthCheck::Diagnostic plus:
A coderef that returns a DBI database handle object or optionally the handle itself.
Can be passed either to new or check.
new
check
HealthCheck::Diagnostic
None
Grant Street Group <developers@grantstreet.com>
This software is Copyright (c) 2018 - 2020 by Grant Street Group.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install HealthCheck::Diagnostic::DBHPing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HealthCheck::Diagnostic::DBHPing
CPAN shell
perl -MCPAN -e shell install HealthCheck::Diagnostic::DBHPing
For more information on module installation, please visit the detailed CPAN module installation guide.