summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-04-21 23:39:50 +0100
committerKHobbits <rob@khobbits.co.uk>2013-04-21 23:39:50 +0100
commitf48871ff29d6bc614a1cd040a7feda7198e5c673 (patch)
treee2c227b2c5c29e2d6ac9219970b4af976ec5ad94
parentc2eb7b05b373de251433745ead8cbc319bc18d61 (diff)
downloadEssentials-f48871ff29d6bc614a1cd040a7feda7198e5c673.tar
Essentials-f48871ff29d6bc614a1cd040a7feda7198e5c673.tar.gz
Essentials-f48871ff29d6bc614a1cd040a7feda7198e5c673.tar.lz
Essentials-f48871ff29d6bc614a1cd040a7feda7198e5c673.tar.xz
Essentials-f48871ff29d6bc614a1cd040a7feda7198e5c673.zip
Attempt to smooth out timer usage.
Add extra sign metrics.
-rw-r--r--BuildAll/nbproject/genfiles.properties2
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsTimer.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java4
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)
{