Added 60s delay to timings enable check.
This commit is contained in:
parent
c9971bb117
commit
1417d31b73
@ -27,6 +27,7 @@ public class LagMeter extends MiniPlugin
|
||||
private double _ticksPerSecond;
|
||||
private double _ticksPerSecondAverage;
|
||||
private long _lastAverage;
|
||||
private long _start;
|
||||
|
||||
private long _lastTick = 0;
|
||||
|
||||
@ -43,6 +44,8 @@ public class LagMeter extends MiniPlugin
|
||||
_clientManager = clientManager;
|
||||
_lastRun = System.currentTimeMillis();
|
||||
_lastAverage = System.currentTimeMillis();
|
||||
|
||||
_start = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -94,19 +97,22 @@ public class LagMeter extends MiniPlugin
|
||||
|
||||
_count++;
|
||||
|
||||
if (_timingsRunning)
|
||||
if (System.currentTimeMillis() - _start > 60000)
|
||||
{
|
||||
if (_ticksPerSecond > 15 || System.currentTimeMillis() - _timingsStarted > 60000)
|
||||
{
|
||||
getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), "timings paste");
|
||||
_timingsRunning = false;
|
||||
}
|
||||
}
|
||||
else if (_ticksPerSecond < 10)
|
||||
{
|
||||
_timingsRunning = true;
|
||||
_timingsStarted = System.currentTimeMillis();
|
||||
getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), "timings on");
|
||||
if (_timingsRunning)
|
||||
{
|
||||
if (_ticksPerSecond > 15 || System.currentTimeMillis() - _timingsStarted > 60000)
|
||||
{
|
||||
getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), "timings paste");
|
||||
_timingsRunning = false;
|
||||
}
|
||||
}
|
||||
else if (_ticksPerSecond < 10)
|
||||
{
|
||||
_timingsRunning = true;
|
||||
_timingsStarted = System.currentTimeMillis();
|
||||
getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), "timings on");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,6 @@
|
||||
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpclient-4.2.jar"/>
|
||||
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-codec-1.6.jar"/>
|
||||
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/gson-2.2.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_60"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
Loading…
Reference in New Issue
Block a user