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();
192193194195196197198199200201202203204205206207208209210211212213214
// load settings Settings.setupVariables(); // initialise metrics try { Metrics metrics = new Metrics(Citizens.this); metrics.addCustomData(new Plotter() { @Override public String getColumnName() { return "Total NPCs"; } @Override public int getValue() { return NPCManager.getList().size(); } }); metrics.start(); } catch (IOException e) { Messaging.log("unable to load metrics"); } // register events per type