File Coverage

blib/lib/Plack/App/ServiceStatus/Elasticsearch.pm
Criterion Covered Total %
statement 8 12 66.6
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 11 19 57.8


line stmt bran cond sub pod time code
1             package Plack::App::ServiceStatus::Elasticsearch;
2              
3             # ABSTRACT: Check Elasticsearch connection
4              
5             our $VERSION = '0.913'; # VERSION
6              
7 1     1   234526 use 5.018;
  1         4  
8 1     1   7 use strict;
  1         2  
  1         32  
9 1     1   10 use warnings;
  1         2  
  1         266  
10              
11             sub check {
12 0     0 0   my ( $class, $es ) = @_;
13              
14 0           my $rv = $es->ping;
15 0 0         return 'ok' if $rv == 1;
16 0           return 'nok', "got: $rv";
17             }
18              
19             1;
20              
21             __END__