-
Notifications
You must be signed in to change notification settings - Fork 7
Using Metrics
Jerom van der Sar edited this page Mar 12, 2014
·
4 revisions
Note: All the original classes for Metrics were refractored into seperate classes for code visibility.
Metrics is provided by BukkitLib for ease of use. Usage is like you would expect:
import net.pravian.bukkitlib.metrics.Graph;
import net.pravian.bukkitlib.metrics.Metrics;
import net.pravian.bukkitlib.metrics.Plotter;
...
public class BukkitLibTest extends BukkitPlugin {
...
@Override
public void onEnable() {
...
try {
final Metrics metrics = new Metrics(plugin);
final Graph coolnessLevel = metrics.createGraph("Coolness Level");
coolnessLevel.addPlotter(new Plotter() {
@Override
public int getValue() {
return 5; // Could be a dynamic value.
}
});
metrics.start();
} catch (IOException ex) {
plugin.logger.warning("Failed to submit metrics");
}
}
}There are however some helpful plotters which are covered in the next tutorial.
Previous: PlayerLobby, Next: Custom Plotters
Aero is not affiliated with Bukkit or Mojang in any way. All rights belong to their respective owners.
- Home
- About
- Tutorial
- Getting Started
- Extending BukkitPlugin
- Logging with BukkitLogger
- Config Handling
- Handling Commands
- Utility Classes
- Implementations
- Using Metrics - mcstats.org
- Concurrency
- Proxy Classes
- Serializable Objects
- The BukkitLib class
- Example projects
- Online Javadocs
- BukkitDev Page
- Changelogs
- Credits