예제 #1
0
 protected function prepareContinuePids(ContinueDto $continueDto)
 {
     $pauseStanderArr = $this->getTerminatorPauseStanderArr();
     $pauseStanderArr[TerminatorPauseStanderConstants::PIDS_FOR_CONTINUE] = $continueDto->getPidsForContinue();
     return $pauseStanderArr;
 }
예제 #2
0
 protected function calculateProcessesNumberToContinue()
 {
     $continueDto = new ContinueDto();
     $possiblePidUsage = 0;
     $pidsForContinue = [];
     /**
      * @var PidCpuMemDto $pidInfo
      */
     foreach ($this->pidsForPause as $pidInfo) {
         if ($possiblePidUsage + $pidInfo->getPidCpuUsage() < $this->allowingCpuUsage) {
             $possiblePidUsage += $pidInfo->getPidCpuUsage();
             $pidsForContinue[] = $pidInfo->getPid();
             unset($this->pidsForPause[$pidInfo->getPid()]);
         } else {
             break;
         }
     }
     $continueDto->setPidsForContinue($pidsForContinue);
     return $continueDto;
 }