| @@ 47-56 (lines=10) @@ | ||
| 44 | * |
|
| 45 | * @return int |
|
| 46 | */ |
|
| 47 | public function getProcessCount($command) |
|
| 48 | { |
|
| 49 | $hash = $this->getKey($command); |
|
| 50 | ||
| 51 | if (!isset($this->informations[$hash])) { |
|
| 52 | $this->computeProcessInformations($command); |
|
| 53 | } |
|
| 54 | ||
| 55 | return $this->informations[$hash]['number']; |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * Return the average CPU usage for the given command |
|
| @@ 65-74 (lines=10) @@ | ||
| 62 | * |
|
| 63 | * @return float |
|
| 64 | */ |
|
| 65 | public function getProcessUsage($command) |
|
| 66 | { |
|
| 67 | $hash = $this->getKey($command); |
|
| 68 | ||
| 69 | if (!isset($this->informations[$hash])) { |
|
| 70 | $this->computeProcessInformations($command); |
|
| 71 | } |
|
| 72 | ||
| 73 | return $this->informations[$hash]['usage']; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * Compute the process usage/number for the given command |
|