mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Attempt to smooth out timer usage.
Add extra sign metrics.
This commit is contained in:
parent
c2eb7b05b3
commit
f48871ff29
5 changed files with 20 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
build.xml.data.CRC32=b4df970c
|
build.xml.data.CRC32=cab45985
|
||||||
build.xml.script.CRC32=7a797370
|
build.xml.script.CRC32=7a797370
|
||||||
build.xml.stylesheet.CRC32=28e38971@1.50.3.46
|
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.
|
# 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);
|
alternativeCommandsHandler = new AlternativeCommandsHandler(this);
|
||||||
|
|
||||||
timer = new EssentialsTimer(this);
|
timer = new EssentialsTimer(this);
|
||||||
getScheduler().scheduleSyncRepeatingTask(this, timer, 100, 100);
|
scheduleSyncRepeatingTask(timer, 1000, 50);
|
||||||
|
|
||||||
Economy.setEss(this);
|
Economy.setEss(this);
|
||||||
execTimer.mark("RegHandler");
|
execTimer.mark("RegHandler");
|
||||||
|
|
|
@ -14,8 +14,8 @@ public class EssentialsTimer implements Runnable
|
||||||
private final transient Set<User> onlineUsers = new HashSet<User>();
|
private final transient Set<User> onlineUsers = new HashSet<User>();
|
||||||
private transient long lastPoll = System.currentTimeMillis();
|
private transient long lastPoll = System.currentTimeMillis();
|
||||||
private final transient LinkedList<Float> history = new LinkedList<Float>();
|
private final transient LinkedList<Float> history = new LinkedList<Float>();
|
||||||
private final int skip1 = 0;
|
private int skip1 = 0;
|
||||||
private final int skip2 = 0;
|
private int skip2 = 0;
|
||||||
private final long maxTime = 10 * 1000000;
|
private final long maxTime = 10 * 1000000;
|
||||||
|
|
||||||
EssentialsTimer(final IEssentials ess)
|
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.metrics.Metrics.Plotter;
|
||||||
import com.earth2me.essentials.register.payment.Method;
|
import com.earth2me.essentials.register.payment.Method;
|
||||||
import com.earth2me.essentials.register.payment.methods.VaultEco;
|
import com.earth2me.essentials.register.payment.methods.VaultEco;
|
||||||
|
import com.earth2me.essentials.signs.EssentialsSign;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
@ -102,7 +103,10 @@ public class MetricsStarter implements Runnable
|
||||||
public int getValue()
|
public int getValue()
|
||||||
{
|
{
|
||||||
ConfigurationSection kits = ess.getSettings().getKits();
|
ConfigurationSection kits = ess.getSettings().getKits();
|
||||||
if (kits == null) { return 0; }
|
if (kits == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return kits.getKeys(false).size();
|
return kits.getKeys(false).size();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -189,6 +193,12 @@ public class MetricsStarter implements Runnable
|
||||||
}
|
}
|
||||||
depGraph.addPlotter(new SimplePlotter(ess.getPermissionsHandler().getName()));
|
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();
|
metrics.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,10 @@ public class EssentialsSign
|
||||||
return _("signFormatTemplate", this.signName);
|
return _("signFormatTemplate", this.signName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.signName;
|
||||||
|
}
|
||||||
|
|
||||||
private String getUsername(final User user)
|
private String getUsername(final User user)
|
||||||
{
|
{
|
||||||
return user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
|
return user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
|
||||||
|
|
Loading…
Reference in a new issue