Further improve server tick loop

Improves how the catchup buffer is handled, allowing it to roll both ways
increasing the effeciency of the thread sleep so it only will sleep once.

Also increases the buffer of the catchup to ensure server stays at 20 TPS unless extreme conditions

Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
This commit is contained in:
Aikar
2016-03-01 23:09:29 -06:00
parent fae673b95c
commit a371d5fefe
3 changed files with 179 additions and 85 deletions

View File

@ -2680,7 +2680,11 @@ public final class CraftServer implements Server {
@Override
public double[] getTPS() {
return new double[]{0, 0, 0}; // TODO
return new double[] {
net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
};
}
// Paper start - adventure sounds