diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-04-21 23:39:50 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-04-21 23:39:50 +0100 |
commit | df159a3defde2bffc3c59d487fda795999fa88e4 (patch) | |
tree | ecdf281e4d993cb4e50c7a4563f67454789eaf95 | |
parent | 4b095bc9c350e0a09e4b7b6f103ca1629c25d5b2 (diff) | |
download | Essentials-df159a3defde2bffc3c59d487fda795999fa88e4.tar Essentials-df159a3defde2bffc3c59d487fda795999fa88e4.tar.gz Essentials-df159a3defde2bffc3c59d487fda795999fa88e4.tar.lz Essentials-df159a3defde2bffc3c59d487fda795999fa88e4.tar.xz Essentials-df159a3defde2bffc3c59d487fda795999fa88e4.zip |
Attempt to smooth out timer usage.
Add extra sign metrics.
5 files changed, 20 insertions, 6 deletions
diff --git a/BuildAll/nbproject/genfiles.properties b/BuildAll/nbproject/genfiles.properties index cf660eaf5..b95cd73c2 100644 --- a/BuildAll/nbproject/genfiles.properties +++ b/BuildAll/nbproject/genfiles.properties @@ -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. diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index a784eb5fb..1a867f195 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -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"); diff --git a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java index f06db1c5e..2c98b6553 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java @@ -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) diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 3e9ee9e49..b22e8470d 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -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; @@ -101,8 +102,11 @@ public class MetricsStarter implements Runnable @Override public int getValue() { - ConfigurationSection kits = ess.getSettings().getKits(); - if (kits == null) { return 0; } + ConfigurationSection kits = ess.getSettings().getKits(); + 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(); } diff --git a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java index 55462e6bd..3e3e095c5 100644 --- a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java +++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java @@ -67,6 +67,10 @@ public class EssentialsSign { return _("signFormatTemplate", this.signName); } + + public String getName() { + return this.signName; + } private String getUsername(final User user) { |