Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/grantstreetgroup/p5-healthcheck-diagnostic-dbhping

Perl HealthCheck Diagnostic for verifying database connectivity - https://grantstreetgroup.github.io/HealthCheck.html
https://github.com/grantstreetgroup/p5-healthcheck-diagnostic-dbhping

Last synced: about 1 month ago
JSON representation

Perl HealthCheck Diagnostic for verifying database connectivity - https://grantstreetgroup.github.io/HealthCheck.html

Awesome Lists containing this project

README

        

# NAME

HealthCheck::Diagnostic::DBHPing - Ping a database handle to check its health

# VERSION

version v1.2.5

# SYNOPSIS

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

# DESCRIPTION

Determines if the database connection is available.
Sets the `status` to "OK" or "CRITICAL" based on the
return value from `dbh->ping`.

# ATTRIBUTES

Those inherited from ["ATTRIBUTES" in HealthCheck::Diagnostic](https://metacpan.org/pod/HealthCheck%3A%3ADiagnostic#ATTRIBUTES) plus:

## dbh

A coderef that returns a
[DBI database handle object](https://metacpan.org/pod/DBI#DBI-DATABSE-HANDLE-OBJECTS)
or optionally the handle itself.

Can be passed either to `new` or `check`.

# DEPENDENCIES

[HealthCheck::Diagnostic](https://metacpan.org/pod/HealthCheck%3A%3ADiagnostic)

# CONFIGURATION AND ENVIRONMENT

None

# AUTHOR

Grant Street Group

# COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 - 2023 by Grant Street Group.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)