summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-03-15 01:17:12 +0000
committerKHobbits <rob@khobbits.co.uk>2012-03-15 01:17:12 +0000
commit5e8fd3993da989d0905e5c5e29cf3f5dd889bf49 (patch)
tree4c4206633c0a8bbc67b424d9eaaa9cab8bb546c7
parentd3033716ca532fb2d327493a5af19a2bd30d57a1 (diff)
downloadEssentials-5e8fd3993da989d0905e5c5e29cf3f5dd889bf49.tar
Essentials-5e8fd3993da989d0905e5c5e29cf3f5dd889bf49.tar.gz
Essentials-5e8fd3993da989d0905e5c5e29cf3f5dd889bf49.tar.lz
Essentials-5e8fd3993da989d0905e5c5e29cf3f5dd889bf49.tar.xz
Essentials-5e8fd3993da989d0905e5c5e29cf3f5dd889bf49.zip
Basic module graph.
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java33
2 files changed, 36 insertions, 6 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
index 8bfec57d1..bc0de9fa4 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
@@ -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();
}
diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java
index a775f68f1..347d74bf6 100644
--- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java
+++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java
@@ -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();
}