| Conditions | 4 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected function ccDecision(Options $options, string $identify, int $idle, int $busy, int $waits) : void |
||
| 31 | { |
||
| 32 | $current = Exceptions::happened($identify, Exceptions::SW_TIMEOUT); |
||
| 33 | |||
| 34 | if ($current > $this->swTimeouts) { |
||
| 35 | $increased = $current - $this->swTimeouts; |
||
| 36 | $this->swTimeouts = $current; |
||
| 37 | } |
||
| 38 | |||
| 39 | $score = $waits / $options->getWaitQMax; |
||
| 40 | $factor = (float) $options->scaleFactor; |
||
| 41 | $threshold = $factor / (($increased ?? 0) + 1); |
||
| 42 | |||
| 43 | if ($score < $threshold) { |
||
| 44 | return; |
||
| 45 | } |
||
| 46 | |||
| 47 | ($target = $this->verdict($options, $idle, $busy)) && $this->resizing($target, 'policy-decision'); |
||
|
|
|||
| 48 | } |
||
| 50 |