diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-03-15 02:12:27 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-03-15 02:12:27 +0000 |
commit | f99e8c066fa30ff46d6cb6984260811c9d4985d5 (patch) | |
tree | f4ae27550ae5f66764108474e925b4128e8b0214 | |
parent | e2423aef469369d8b3878f85fcb7481dd92aa9eb (diff) | |
download | Essentials-f99e8c066fa30ff46d6cb6984260811c9d4985d5.tar Essentials-f99e8c066fa30ff46d6cb6984260811c9d4985d5.tar.gz Essentials-f99e8c066fa30ff46d6cb6984260811c9d4985d5.tar.lz Essentials-f99e8c066fa30ff46d6cb6984260811c9d4985d5.tar.xz Essentials-f99e8c066fa30ff46d6cb6984260811c9d4985d5.zip |
Adding some simple feature metrics.
-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 |