Skip to content

Commit 7a4e01f

Browse files
committed
Added task failure counter to f3
1 parent 45aaf9b commit 7a4e01f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/main/java/me/cortex/voxy/client/core/model/ModelFactory.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
66
import it.unimi.dsi.fastutil.objects.ObjectSet;
77
import me.cortex.voxy.client.core.gl.Capabilities;
8-
import me.cortex.voxy.client.core.model.bakery.ModelTextureBakery;
98
import me.cortex.voxy.client.core.model.bakery.ModelTextureBakery2;
109
import me.cortex.voxy.client.core.rendering.util.RawDownloadStream;
1110
import me.cortex.voxy.client.core.rendering.util.UploadStream;
12-
import me.cortex.voxy.common.Logger;
1311
import me.cortex.voxy.common.world.other.Mapper;
1412
import net.minecraft.block.Block;
1513
import net.minecraft.block.BlockState;

src/main/java/me/cortex/voxy/client/core/rendering/building/RenderGenerationService.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
// and process accordingly
3232
public class RenderGenerationService {
3333
private static final int MAX_HOLDING_SECTION_COUNT = 1000;
34+
35+
public static final AtomicInteger MESH_FAILED_COUNTER = new AtomicInteger();
3436
private static final AtomicInteger COUNTER = new AtomicInteger();
3537
private static final class BuildTask {
3638
WorldSection section;
@@ -168,6 +170,7 @@ private void processJob(RenderDataFactory45 factory, IntOpenHashSet seenMissedId
168170
this.taskMapLock.unlockWrite(stamp);
169171

170172
if (other != null) {//Weve been replaced
173+
MESH_FAILED_COUNTER.incrementAndGet();
171174
//Request the block
172175
if (e.isIdBlockId) {
173176
//TODO: maybe move this to _after_ task as been readded to queue??
@@ -206,6 +209,7 @@ private void processJob(RenderDataFactory45 factory, IntOpenHashSet seenMissedId
206209
}
207210

208211
if (task.hasDoneModelRequestInner && task.hasDoneModelRequestOuter) {
212+
MESH_FAILED_COUNTER.incrementAndGet();
209213
task.attempts++;
210214
try {
211215
Thread.sleep(1);
@@ -222,6 +226,7 @@ private void processJob(RenderDataFactory45 factory, IntOpenHashSet seenMissedId
222226
//If this happens... aahaha painnnn
223227
if (task.hasDoneModelRequestOuter) {
224228
task.attempts++;
229+
MESH_FAILED_COUNTER.incrementAndGet();
225230
}
226231

227232
if ((!task.hasDoneModelRequestOuter) && e.auxData != null) {
@@ -332,8 +337,16 @@ public void shutdown() {
332337
}
333338
}
334339

340+
private long lastChangedTime = 0;
341+
private int failedCounter = 0;
335342
public void addDebugData(List<String> debug) {
336-
debug.add("RSSQ: " + this.taskQueueCount.get());//render section service queue
343+
if (System.currentTimeMillis()-this.lastChangedTime > 1000) {
344+
this.failedCounter = 0;
345+
this.lastChangedTime = System.currentTimeMillis();
346+
}
347+
this.failedCounter += MESH_FAILED_COUNTER.getAndSet(0);
348+
debug.add("RSSQ/TFC: " + this.taskQueueCount.get() + "/" + this.failedCounter);//render section service queue, Task Fail Counter
349+
337350
}
338351

339352
public int getTaskCount() {

0 commit comments

Comments
 (0)