mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-23 19:57:43 +00:00
Adding some simple feature metrics.
This commit is contained in:
parent
8776f4c1c0
commit
b85756f8b1
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue