1 | <?php |
||
18 | class DecisionManager |
||
19 | { |
||
20 | protected $server; |
||
21 | protected $cpuThreshold; |
||
22 | protected $processStatus; |
||
23 | protected $dispatcher; |
||
24 | protected $logger; |
||
25 | |||
26 | /** |
||
27 | * Set the server helper |
||
28 | * |
||
29 | * @param ServerInterface $server |
||
30 | */ |
||
31 | 3 | public function setServer(ServerInterface $server) |
|
35 | |||
36 | /** |
||
37 | * Set the CPU top threshold |
||
38 | * |
||
39 | * @param float $threshold |
||
40 | */ |
||
41 | 3 | public function setCpuThreshold($threshold) |
|
45 | |||
46 | /** |
||
47 | * Set the process status handler |
||
48 | * |
||
49 | * @param ProcessStatusHandler $handler |
||
50 | */ |
||
51 | 3 | public function setProcessStatusHandler(ProcessStatusHandler $handler) |
|
55 | |||
56 | /** |
||
57 | * Set the event dispatcher |
||
58 | * |
||
59 | * @param EventDispatcherInterface $dispatcher |
||
60 | */ |
||
61 | public function setDispatcher(EventDispatcherInterface $dispatcher) |
||
65 | |||
66 | /** |
||
67 | * Set the logger |
||
68 | * |
||
69 | * @param LoggerInterface $logger |
||
70 | */ |
||
71 | public function setLogger(LoggerInterface $logger) |
||
75 | |||
76 | /** |
||
77 | * Return the number of processes that can be launched on the server |
||
78 | * |
||
79 | * @param string $command Command name to analyze |
||
80 | * |
||
81 | * @return int |
||
82 | */ |
||
83 | 3 | public function getAllowedProcesses($command) |
|
103 | |||
104 | /** |
||
105 | * Instruct the bundle to run all the process it can |
||
106 | * and dispatch alerts if necessary |
||
107 | * |
||
108 | * @param string $name Symfony command name being run |
||
109 | * @param InputInterface $input Command input arguments |
||
110 | */ |
||
111 | public function provision($name, InputInterface $input) |
||
175 | } |
||
176 |