9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2026-01-04 15:41:30 +00:00

Improved pack Benchmarking not done yet..

This commit is contained in:
RePixelatedMC
2023-10-28 20:51:32 +02:00
parent a12cb59a51
commit 8ba8627281
2 changed files with 17 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package com.volmit.iris.core.tools;
import com.volmit.iris.Iris;
import com.volmit.iris.core.pregenerator.IrisPregenerator;
import com.volmit.iris.core.pregenerator.LazyPregenerator;
import com.volmit.iris.core.pregenerator.PregenTask;
import com.volmit.iris.util.exceptions.IrisException;
import com.volmit.iris.util.format.C;
@@ -87,8 +88,6 @@ public class IrisPackBenchmarking {
while (true) {
totalChunks = IrisPregenerator.getLongTotalChunks();
generatedChunks = IrisPregenerator.getLongGeneratedChunks();
Iris.info("TEST: "+ totalChunks);
Iris.info("TEST2: "+ generatedChunks);
if(totalChunks > 0) {
if (generatedChunks >= totalChunks) {
Iris.info("Benchmark Completed!");
@@ -123,6 +122,21 @@ public class IrisPackBenchmarking {
.build(), Bukkit.getWorld("Benchmark")
);
}
static void startLazyBenchmark(){
int x = 0;
int z = 0;
LazyPregenerator.LazyPregenJob pregenJob = LazyPregenerator.LazyPregenJob.builder()
.world("Benchmark")
.healingPosition(0)
.healing(false)
.chunksPerMinute(3200)
.radiusBlocks(5000)
.position(0)
.build();
LazyPregenerator pregenerator = new LazyPregenerator(pregenJob, new File("plugins/Iris/lazygen.json"));
pregenerator.start();
}
public static double calculateAverageCPS() {
double elapsedTimeSec = elapsedTimeNs / 1_000_000_000.0; // Convert to seconds
return generatedChunks / elapsedTimeSec;