Completed
Push — master ( e19dd9...c43d00 )
by Freek
02:00
created

Elasticsearch::performNextRunInMinutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Spatie\ServerMonitor\CheckDefinitions;
4
5
use Symfony\Component\Process\Process;
6
7
final class Elasticsearch extends CheckDefinition
8
{
9
    public $command = 'curl http://localhost:9200';
10
11
    public function handleSuccessfulProcess(Process $process)
12
    {
13
        $checkSucceeded = str_contains($process->getOutput(), 'lucene_version');
14
15
        if ($checkSucceeded) {
16
            $this->check->succeeded('is up');
17
18
            return;
19
        }
20
21
        $this->check->failed('is down');
22
    }
23
}
24