Class MetricsService

java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.MetricsService

public class MetricsService extends Object
This Class represents a Metrics Service that sends data to https://bstats.org/ This data is used to analyse the usage of this Plugin.

You can find more info in the README file of this Project on GitHub.
Note: To start the metrics you will need to be calling start()

Author:
WalshyDev
  • Constructor Details

    • MetricsService

      public MetricsService(@Nonnull Slimefun plugin)
      This constructs a new instance of our MetricsService.
      Parameters:
      plugin - Our Slimefun instance
  • Method Details

    • start

      public void start()
      This method loads the metric module and starts the metrics collection.
    • cleanUp

      public void cleanUp()
      This will close the child ClassLoader and mark all the resources held under this no longer in use, they will be cleaned up the next GC run.
    • checkForUpdate

      public boolean checkForUpdate(@Nullable String currentVersion)
      Checks for a new update and compares it against the current version. If there is a new version available then this returns true.
      Parameters:
      currentVersion - The current version which is being used.
      Returns:
      if there is an update available.
    • getVersion

      @Nullable public String getVersion()
      Returns the currently downloaded metrics version. This can change! It may be null or an older version before it has downloaded a newer one.
      Returns:
      The current version or null if not loaded.
    • hasAutoUpdates

      public boolean hasAutoUpdates()
      Returns if the current server has metrics auto-updates enabled.
      Returns:
      True if the current server has metrics auto-updates enabled.