Send metrics information on if this server uses timings

This commit is contained in:
NuclearW 2012-05-19 00:42:50 -04:00
parent 898d8c6449
commit 9726ac6f12

View File

@ -16,6 +16,7 @@ import com.gmail.nossr50.runnables.*;
import com.gmail.nossr50.util.Database; import com.gmail.nossr50.util.Database;
import com.gmail.nossr50.util.Leaderboard; import com.gmail.nossr50.util.Leaderboard;
import com.gmail.nossr50.util.Metrics; import com.gmail.nossr50.util.Metrics;
import com.gmail.nossr50.util.Metrics.Graph;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
import com.gmail.nossr50.util.blockmeta.ChunkletManager; import com.gmail.nossr50.util.blockmeta.ChunkletManager;
import com.gmail.nossr50.util.blockmeta.ChunkletManagerFactory; import com.gmail.nossr50.util.blockmeta.ChunkletManagerFactory;
@ -138,6 +139,25 @@ public class mcMMO extends JavaPlugin {
if (configInstance.getStatsTrackingEnabled()) { if (configInstance.getStatsTrackingEnabled()) {
try { try {
Metrics metrics = new Metrics(this); Metrics metrics = new Metrics(this);
Graph graph = metrics.createGraph("Percentage of servers using timings");
if(pm.useTimings()) {
graph.addPlotter(new Metrics.Plotter("Enabled") {
@Override
public int getValue() {
return 1;
}
});
} else {
graph.addPlotter(new Metrics.Plotter("Disabled") {
@Override
public int getValue() {
return 1;
}
});
}
metrics.start(); metrics.start();
} }
catch (IOException e) { catch (IOException e) {