Merge pull request #1003 from CocoTheOwner/better-pregen-pred

Predict the ETA for pregeneration more rapidly
This commit is contained in:
Brian Fopiano
2023-07-29 03:04:07 -07:00
committed by GitHub
@@ -111,8 +111,12 @@ public class IrisPregenerator {
} }
private long computeETA() { private long computeETA() {
return (long) ((totalChunks.get() - generated.get()) * return (long) (totalChunks.get() > 1024 ? // Generated chunks exceed 1/8th of total?
((double) (M.ms() - startTime.get()) / (double) generated.get())); // If yes, use smooth function (which gets more accurate over time since its less sensitive to outliers)
((totalChunks.get() - generated.get()) * ((double) (M.ms() - startTime.get()) / (double) generated.get())) :
// If no, use quick function (which is less accurate over time but responds better to the initial delay)
((totalChunks.get() - generated.get()) / chunksPerSecond.getAverage()) * 1000 //
);
} }
public void close() { public void close() {