backport 23071d257 + deprecations: Extract process-related functions from Utils into a separate Process class

This commit is contained in:
Dylan K. Taylor
2019-03-24 18:57:32 +00:00
parent a8433697ad
commit 4635b93f4d
9 changed files with 218 additions and 117 deletions

View File

@ -26,6 +26,7 @@ namespace pocketmine\scheduler;
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\Server;
use pocketmine\utils\Internet;
use pocketmine\utils\Process;
use pocketmine\utils\Utils;
use pocketmine\utils\UUID;
use pocketmine\utils\VersionString;
@ -135,12 +136,12 @@ class SendUsageTask extends AsyncTask{
"historyList" => array_values($playerList)
];
$info = Utils::getMemoryUsage(true);
$info = Process::getMemoryUsage(true);
$data["system"] = [
"mainMemory" => $info[0],
"totalMemory" => $info[1],
"availableMemory" => $info[2],
"threadCount" => Utils::getThreadCount()
"threadCount" => Process::getThreadCount()
];
break;