Skip to content

Commit

Permalink
Added profiler to island calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed May 6, 2023
1 parent dd8f48b commit e5136f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -5,6 +5,7 @@

public enum ProfileType {

CALCULATE_ISLAND,
CREATE_ISLAND,
DISBAND_ISLAND,
LOAD_CHUNK,
Expand Down
Expand Up @@ -15,6 +15,8 @@
import com.bgsoftware.superiorskyblock.core.key.KeyMapImpl;
import com.bgsoftware.superiorskyblock.core.logging.Debug;
import com.bgsoftware.superiorskyblock.core.logging.Log;
import com.bgsoftware.superiorskyblock.core.profiler.ProfileType;
import com.bgsoftware.superiorskyblock.core.profiler.Profiler;
import com.bgsoftware.superiorskyblock.core.threads.BukkitExecutor;
import com.bgsoftware.superiorskyblock.island.IslandUtils;
import com.bgsoftware.superiorskyblock.world.chunk.ChunkLoadReason;
Expand Down Expand Up @@ -51,6 +53,7 @@ public static DefaultIslandCalculationAlgorithm getInstance() {
public CompletableFuture<IslandCalculationResult> calculateIsland(Island island) {
CompletableFutureList<List<CalculatedChunk>> chunksToLoad = new CompletableFutureList<>();

long profiler = Profiler.start(ProfileType.CALCULATE_ISLAND);
Log.debug(Debug.CHUNK_CALCULATION, island.getOwner().getName());

if (!plugin.getProviders().hasSnapshotsSupport()) {
Expand Down Expand Up @@ -151,6 +154,8 @@ public CompletableFuture<IslandCalculationResult> calculateIsland(Island island)

chunksToCheck.clear();

Profiler.end(profiler);

result.complete(blockCounts);
});

Expand Down

0 comments on commit e5136f2

Please sign in to comment.