mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Attempt to smooth out timer usage.
Add extra sign metrics.
This commit is contained in:
parent
c2eb7b05b3
commit
f48871ff29
@ -1,4 +1,4 @@
|
||||
build.xml.data.CRC32=b4df970c
|
||||
build.xml.data.CRC32=cab45985
|
||||
build.xml.script.CRC32=7a797370
|
||||
build.xml.stylesheet.CRC32=28e38971@1.50.3.46
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
|
@ -217,7 +217,7 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
alternativeCommandsHandler = new AlternativeCommandsHandler(this);
|
||||
|
||||
timer = new EssentialsTimer(this);
|
||||
getScheduler().scheduleSyncRepeatingTask(this, timer, 100, 100);
|
||||
scheduleSyncRepeatingTask(timer, 1000, 50);
|
||||
|
||||
Economy.setEss(this);
|
||||
execTimer.mark("RegHandler");
|
||||
|
@ -14,8 +14,8 @@ public class EssentialsTimer implements Runnable
|
||||
private final transient Set<User> onlineUsers = new HashSet<User>();
|
||||
private transient long lastPoll = System.currentTimeMillis();
|
||||
private final transient LinkedList<Float> history = new LinkedList<Float>();
|
||||
private final int skip1 = 0;
|
||||
private final int skip2 = 0;
|
||||
private int skip1 = 0;
|
||||
private int skip2 = 0;
|
||||
private final long maxTime = 10 * 1000000;
|
||||
|
||||
EssentialsTimer(final IEssentials ess)
|
||||
|
@ -5,6 +5,7 @@ import com.earth2me.essentials.metrics.Metrics.Graph;
|
||||
import com.earth2me.essentials.metrics.Metrics.Plotter;
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
import com.earth2me.essentials.register.payment.methods.VaultEco;
|
||||
import com.earth2me.essentials.signs.EssentialsSign;
|
||||
import java.util.Locale;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@ -102,7 +103,10 @@ public class MetricsStarter implements Runnable
|
||||
public int getValue()
|
||||
{
|
||||
ConfigurationSection kits = ess.getSettings().getKits();
|
||||
if (kits == null) { return 0; }
|
||||
if (kits == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return kits.getKeys(false).size();
|
||||
}
|
||||
});
|
||||
@ -189,6 +193,12 @@ public class MetricsStarter implements Runnable
|
||||
}
|
||||
depGraph.addPlotter(new SimplePlotter(ess.getPermissionsHandler().getName()));
|
||||
|
||||
final Graph signGraph = metrics.createGraph("Signs");
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
signGraph.addPlotter(new SimplePlotter(sign.getName()));
|
||||
}
|
||||
|
||||
metrics.start();
|
||||
|
||||
}
|
||||
|
@ -68,6 +68,10 @@ public class EssentialsSign
|
||||
return _("signFormatTemplate", this.signName);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.signName;
|
||||
}
|
||||
|
||||
private String getUsername(final User user)
|
||||
{
|
||||
return user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
|
||||
|
Loading…
Reference in New Issue
Block a user