The metrics class obtains data about a plugin and submits statistics about it to the metrics backend.
Public methods provided by this class:
Graph createGraph(String name); void addCustomData(Metrics.Plotter plotter); void start();
104105106107108109110111112113114115116117118119120121122123
log.info(getDescription().getName() + " (v" + getDescription().getVersion() + ") enabled"); // Enable MCStats Metrics try { Metrics metrics = new Metrics(this); // Setup a graph for keeping track of Permission handler user Metrics.Graph phGraph = metrics.createGraph("Permission Handler"); phGraph.addPlotter(new Metrics.Plotter(permHandler) { @Override public int getValue() { return 1; } }); metrics.start(); } catch (IOException ex) { // Something went wrong. Owell. } }