Basic module graph.

This commit is contained in:
KHobbits 2012-03-15 01:17:12 +00:00
parent d3033716ca
commit 5e8fd3993d
2 changed files with 36 additions and 6 deletions

View File

@ -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();
}

View File

@ -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();
}