Lag bar now shows target TPS from /tick command
This commit is contained in:
parent
5d294ea172
commit
1c22518dd9
@ -347,19 +347,19 @@ public class PerformanceAnalysisManager implements Listener {
|
|||||||
: (avgTickDuration1s < 46) ? NamedTextColor.GOLD
|
: (avgTickDuration1s < 46) ? NamedTextColor.GOLD
|
||||||
: NamedTextColor.RED;
|
: NamedTextColor.RED;
|
||||||
|
|
||||||
timings = text("(Tr:")
|
timings = text("(R/W/S:")
|
||||||
.then(text(Math.round(avgTickCPUTime1s) + "ms").color(avgTickCPUTime1sColor))
|
.then(text(Math.round(avgTickCPUTime1s)).color(avgTickCPUTime1sColor))
|
||||||
.thenText(" Tw:")
|
.thenText("/")
|
||||||
.then(text(Math.round(avgTickWaitingTime1s) + "ms").color(avgTickWaitingTime1sColor))
|
.then(text(Math.round(avgTickWaitingTime1s)).color(avgTickWaitingTime1sColor))
|
||||||
.thenText(" S:")
|
.thenText("/")
|
||||||
.then(text(Math.round(avgInterTickDuration1s) + "ms").color(avgInterTickDuration1sColor))
|
.then(text(Math.round(avgInterTickDuration1s)).color(avgInterTickDuration1sColor))
|
||||||
.thenText(")");
|
.thenText("ms)");
|
||||||
}
|
}
|
||||||
|
|
||||||
title = infoText("TPS [")
|
title = infoText("TPS [")
|
||||||
.thenLegacyText(s.toString())
|
.thenLegacyText(s.toString())
|
||||||
.thenText("] ")
|
.thenText("] ")
|
||||||
.then(text(tps1sDisplay+"/20 ").color(tps1sGradient.pickColorAt(tps1s)))
|
.then(text(tps1sDisplay + "/" + getTargetTickRate() + " ").color(tps1sGradient.pickColorAt(tps1s)))
|
||||||
.then(timings);
|
.then(timings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,6 +448,12 @@ public class PerformanceAnalysisManager implements Listener {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static int getTargetTickRate() {
|
||||||
|
return Math.round(Bukkit.getServerTickManager().getTickRate());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void gc(CommandSender sender) {
|
public static void gc(CommandSender sender) {
|
||||||
|
Loading…
Reference in New Issue
Block a user