@@ 15-23 (lines=9) @@ | ||
12 | { |
|
13 | private $checks = []; |
|
14 | ||
15 | public function __construct(array $configs) |
|
16 | { |
|
17 | foreach ($configs as $name => $config) { |
|
18 | $check = new HttpService($config['host'], $config['port'], $config['path'], $config['status_code'], $config['content']); |
|
19 | $check->setLabel(sprintf('Http Service "%s"', $name)); |
|
20 | ||
21 | $this->checks[sprintf('http_service_%s', $name)] = $check; |
|
22 | } |
|
23 | } |
|
24 | ||
25 | public function getChecks() |
|
26 | { |
@@ 15-27 (lines=13) @@ | ||
12 | { |
|
13 | private $checks = []; |
|
14 | ||
15 | public function __construct(array $configs) |
|
16 | { |
|
17 | foreach ($configs as $name => $config) { |
|
18 | if (isset($config['dsn'])) { |
|
19 | $this->parseDsn($config); |
|
20 | } |
|
21 | ||
22 | $check = new Redis($config['host'], $config['port'], $config['password']); |
|
23 | $check->setLabel(\sprintf('Redis "%s"', $name)); |
|
24 | ||
25 | $this->checks[\sprintf('redis_%s', $name)] = $check; |
|
26 | } |
|
27 | } |
|
28 | ||
29 | private function parseDsn(array &$config) |
|
30 | { |