Interface MetricsCustomizer

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MetricsCustomizer
Adds custom charts to the bStats metrics that ZetaCorePlugin creates when ZetaPlugin.bstatsId() is set.

Provide implementations as services or beans; all of them are applied.

 @Service
 public class StorageMetrics implements MetricsCustomizer {
     private final StorageConfig config;

     public StorageMetrics(StorageConfig config) {
         this.config = config;
     }

     @Override
     public void customize(Metrics metrics) {
         metrics.addCustomChart(new Metrics.SimplePie("storage_type", () -> config.type));
     }
 }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    customize(Metrics metrics)
    Adds charts to the metrics.
  • Method Details

    • customize

      void customize(Metrics metrics)
      Adds charts to the metrics.
      Parameters:
      metrics - The plugin's metrics.