mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-25 02:27:33 +01:00
Basic module graph.
This commit is contained in:
parent
d3033716ca
commit
5e8fd3993d
@ -730,7 +730,7 @@ public class EssentialsUpgrade
|
||||
doneFile.setProperty("updateSpawnsToNewSpawnsConfig", true);
|
||||
doneFile.save();
|
||||
}
|
||||
|
||||
|
||||
private void updateJailsToNewJailsConfig()
|
||||
{
|
||||
if (doneFile.getBoolean("updateJailsToNewJailsConfig", false))
|
||||
@ -777,13 +777,14 @@ public class EssentialsUpgrade
|
||||
doneFile.setProperty("updateJailsToNewJailsConfig", true);
|
||||
doneFile.save();
|
||||
}
|
||||
|
||||
private void warnMetrics() {
|
||||
|
||||
private void warnMetrics()
|
||||
{
|
||||
if (doneFile.getBoolean("warnMetrics", false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
ess.getSettings().setMetricsEnabled(false);
|
||||
ess.getSettings().setMetricsEnabled(false);
|
||||
doneFile.setProperty("warnMetrics", true);
|
||||
doneFile.save();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.earth2me.essentials.metrics;
|
||||
|
||||
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.metrics.Metrics.Graph;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@ -11,6 +11,17 @@ public class MetricsStarter implements Runnable
|
||||
private final IEssentials ess;
|
||||
private transient Boolean start;
|
||||
|
||||
|
||||
private enum Modules
|
||||
{
|
||||
Essentials,
|
||||
EssentialsChat,
|
||||
EssentialsSpawn,
|
||||
EssentialsProtect,
|
||||
EssentialsGeoIP,
|
||||
EssentialsXMPP
|
||||
};
|
||||
|
||||
public MetricsStarter(final IEssentials plugin)
|
||||
{
|
||||
ess = plugin;
|
||||
@ -45,7 +56,25 @@ public class MetricsStarter implements Runnable
|
||||
{
|
||||
try
|
||||
{
|
||||
final Metrics metrics = new Metrics(ess);
|
||||
final Metrics metrics = new Metrics(ess);
|
||||
|
||||
Graph moduleGraph = metrics.createGraph("Modules Used");
|
||||
for (Modules module : Modules.values())
|
||||
{
|
||||
final String moduleName = module.toString();
|
||||
if (ess.getServer().getPluginManager().isPluginEnabled(moduleName))
|
||||
{
|
||||
moduleGraph.addPlotter(new Metrics.Plotter(moduleName)
|
||||
{
|
||||
@Override
|
||||
public int getValue()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
metrics.start();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user