Conditions | 3 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function resolve(Process $process) |
||
13 | { |
||
14 | $percentage = $this->getDiskUsagePercentage($process->getOutput()); |
||
15 | |||
16 | $message = "usage at {$percentage}%"; |
||
17 | |||
18 | $thresholds = config('server-monitor.diskspace_percentage_threshold', [ |
||
19 | 'fail' => 80, |
||
20 | 'warning' => 90, |
||
21 | ]); |
||
22 | |||
23 | if ($percentage >= $thresholds['fail']) { |
||
24 | $this->check->fail($message); |
||
25 | |||
26 | return; |
||
27 | } |
||
28 | |||
29 | if ($percentage >= $thresholds['warning']) { |
||
30 | $this->check->warn($message); |
||
31 | |||
32 | return; |
||
33 | } |
||
34 | |||
35 | $this->check->succeed($message); |
||
36 | } |
||
37 | |||
43 |