Skip to content
Hidendra edited this page Mar 7, 2012 · 28 revisions

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 what you want if you want to submit your own data.
  • MetricsLite: A basic, "lite" version of Metrics which does not contain any custom data or custom graphing utilities. This is what you want if you do not yet are submitting your own data. This can be swapped with the fully featured Metrics class later on if you so choose to want to use it instead.

As for basic usage, submitting data is extremely simple:

try {
    Metrics metrics = new Metrics(plugin);
    metrics.start();
} catch (IOException e) {
    // Failed to submit the stats :-(
}

See also

Admin Portal

Custom Graphs

Clone this wiki locally