-
Notifications
You must be signed in to change notification settings - Fork 79
Usage
Implementing Metrics into your plugin is both quick and easy. There is no plugin to link, only one class. Download one of the classes from the Bukkit folder and place it into your plugin; preferably into your own package, so as to not cause conflicts with other plugins.
In the folder you will see a Metrics and MetricsLite class. Here are the differences:
- Metrics: The fully featured version of the class. It supports custom data and custom graphs and is required if you want to submit your own numerical data.
- MetricsLite: A basic, "lite" version of Metrics which does not contain any custom data or custom graphing utilities. This version is unable to submit custom data. This can be later swapped with the fully featured Metrics class if you so choose to want to use it instead.
As for basic usage, submitting data is extremely simple and can be done by adding something similar to the following to your onEnable()
method. This only needs to be called once:
try {
Metrics metrics = new Metrics(this);
metrics.start();
} catch (IOException e) {
// Failed to submit the stats :-(
}
Plugin not showing up on http://mcstats.org?
Ensure the following:
- Your plugin is compiling and building correctly with zero errors
- In
config/PluginMetrics/config.yml
ensureopt-out
is set to false - If there is a firewall preventing outbound connections, ensure traffic is allowed to mcstats.org port 80
Most authors will want access to the Admin Portal so they can edit their plugin (mainly just the author field and if you use custom graphs, then settings for those). Note that this is not required for stat collection -- it is simply an extra.
To obtain access:
- Register at http://mcstats.org/admin/
- Add your plugin
- This is a manual process and just needs to be checked over by staff (aka Hidendra). Once this is done you'll receive an email if you provided one.