public static function getStatus($params)
 {
     try {
         $return = System::getStatus();
     } catch (Exception $e) {
         throw new RpcException($e->getMessage(), -31001);
     }
     return $return;
 }
 private function status()
 {
     list($pid, $status, $queue) = SourceSystem::getStatus();
     $return = "\n *** Extender Status Resume *** \n";
     $return .= "  ------------------------------ \n\n";
     $return .= " - Process PID: " . $this->color->convert("%g" . $pid . "%n") . "\n";
     $return .= " - Process running since: " . $this->color->convert("%g" . date("r", (int) $status["STARTED"]) . "%n") . "\n";
     $return .= " - Process runtime (sec): " . $this->color->convert("%g" . (int) $status["TIME"] . "%n") . "\n\n";
     $return .= " - Running jobs: " . $this->color->convert("%g" . $queue["RUNNING"] . "%n") . "\n";
     $return .= " - Queued jobs: " . $this->color->convert("%g" . $queue["QUEUED"] . "%n") . "\n\n";
     $return .= " - Current Status: " . ($status["RUNNING"] == 1 ? $this->color->convert("%gRUNNING%n") : $this->color->convert("%yPAUSED%n")) . "\n";
     $return .= " - Completed jobs: " . $this->color->convert("%g" . $status["COMPLETED"] . "%n") . "\n";
     $return .= " - Failed jobs: " . $this->color->convert("%r" . $status["FAILED"] . "%n") . "\n\n";
     $return .= " - Current CPU load (avg): " . $this->color->convert("%g" . implode(", ", $status["CPUAVG"]) . "%n") . "\n";
     $return .= " - Allocated memory (real): " . $this->color->convert("%g" . self::convert($status["MEM"]) . "%n") . "\n";
     $return .= " - Allocated memory (peak): " . $this->color->convert("%g" . self::convert($status["MEMPEAK"]) . "%n") . "\n\n";
     $return .= " - User: "******"%g" . $status["USER"] . "%n") . "\n";
     $return .= " - Niceness: " . $this->color->convert("%g" . $status["NICENESS"] . "%n") . "\n\n";
     return $return;
 }