*/ private static array $aggregators = []; private static function newTimer(string $worldName, string $timerName) : TimingsHandler{ $aggregator = self::$aggregators[$timerName] ??= new TimingsHandler("Worlds - $timerName"); //displayed in Minecraft primary table return new TimingsHandler("$worldName - $timerName", $aggregator); } public function __construct(World $world){ $name = $world->getFolderName(); $this->setBlock = self::newTimer($name, "Set Blocks"); $this->doBlockLightUpdates = self::newTimer($name, "Block Light Updates"); $this->doBlockSkyLightUpdates = self::newTimer($name, "Sky Light Updates"); $this->doChunkUnload = self::newTimer($name, "Unload Chunks"); $this->scheduledBlockUpdates = self::newTimer($name, "Scheduled Block Updates"); $this->neighbourBlockUpdates = self::newTimer($name, "Neighbour Block Updates"); $this->randomChunkUpdates = self::newTimer($name, "Random Chunk Updates"); $this->randomChunkUpdatesChunkSelection = self::newTimer($name, "Random Chunk Updates - Chunk Selection"); $this->doChunkGC = self::newTimer($name, "Garbage Collection"); $this->entityTick = self::newTimer($name, "Entity Tick"); $this->tileTick = self::newTimer($name, "Block Entity Tick"); $this->doTick = self::newTimer($name, "World Tick"); $this->syncChunkSend = self::newTimer($name, "Player Send Chunks"); $this->syncChunkSendPrepare = self::newTimer($name, "Player Send Chunk Prepare"); $this->syncChunkLoad = self::newTimer($name, "Chunk Load"); $this->syncChunkLoadData = self::newTimer($name, "Chunk Load - Data"); $this->syncChunkLoadFixInvalidBlocks = self::newTimer($name, "Chunk Load - Fix Invalid Blocks"); $this->syncChunkLoadEntities = self::newTimer($name, "Chunk Load - Entities"); $this->syncChunkLoadTileEntities = self::newTimer($name, "Chunk Load - Block Entities"); $this->syncDataSave = self::newTimer($name, "Data Save"); $this->syncChunkSave = self::newTimer($name, "Chunk Save"); $this->chunkPopulationOrder = self::newTimer($name, "Chunk Population - Order"); $this->chunkPopulationCompletion = self::newTimer($name, "Chunk Population - Completion"); } }