Conditions | 5 |
Paths | 12 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | protected function invokeTest() |
||
37 | { |
||
38 | $states = array(); |
||
39 | foreach ($this->tests as $server) { |
||
40 | $states[] = $server->getState(); |
||
41 | } |
||
42 | $state = min($states); |
||
43 | $this->setState($state); |
||
44 | |||
45 | if ($state === State::OK) { |
||
46 | $this->addMessage(State::OK, 'Memcache Server Group Health', 'Group ' . $this->group, 'Group is healthy'); |
||
47 | } elseif ($state === State::WARNING) { |
||
48 | $this->addMessage(State::WARNING, 'Memcache Server Group Health', 'Group ' . $this->group, 'Group is crippled'); |
||
49 | } else { |
||
50 | $this->addMessage(State::ERROR, 'Memcache Server Group Health', 'Group ' . $this->group, 'Group is down'); |
||
51 | } |
||
52 | |||
53 | foreach ($this->tests as $server) { |
||
54 | $this->addOutput($server->getOutput()); |
||
55 | $this->setMessages(array_merge($this->getMessages(), $server->getMessages())); |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 |