diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 120b22742..7c79b6406 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -2,7 +2,9 @@ package com.earth2me.essentials.metrics; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.metrics.Metrics.Graph; +import com.earth2me.essentials.metrics.Metrics.Plotter; import java.io.IOException; +import java.util.Locale; import java.util.logging.Level; @@ -64,17 +66,39 @@ public class MetricsStarter implements Runnable final String moduleName = module.toString(); if (ess.getServer().getPluginManager().isPluginEnabled(moduleName)) { - moduleGraph.addPlotter(new Metrics.Plotter(moduleName) - { - @Override - public int getValue() - { - return 1; - } - }); + moduleGraph.addPlotter(new SimplePlotter(moduleName)); } } + Graph localeGraph = metrics.createGraph("Locale"); + localeGraph.addPlotter(new SimplePlotter(ess.getI18n().getCurrentLocale().getDisplayLanguage(Locale.ENGLISH))); + + Graph featureGraph = metrics.createGraph("Features"); + featureGraph.addPlotter(new Plotter("Unique Accounts") + { + @Override + public int getValue() + { + return ess.getUserMap().getUniqueUsers(); + } + }); + featureGraph.addPlotter(new Plotter("Kits") + { + @Override + public int getValue() + { + return ess.getSettings().getKits().getKeys(false).size(); + } + }); + featureGraph.addPlotter(new Plotter("Warps") + { + @Override + public int getValue() + { + return ess.getWarps().getWarpNames().size(); + } + }); + metrics.start(); } @@ -100,4 +124,19 @@ public class MetricsStarter implements Runnable { return start; } + + + private class SimplePlotter extends Plotter + { + public SimplePlotter(final String name) + { + super(name); + } + + @Override + public int getValue() + { + return 1; + } + } }
\ No newline at end of file |