Class MetricsService
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.MetricsService
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 Summary
ConstructorDescriptionMetricsService
(Slimefun plugin) This constructs a new instance of ourMetricsService
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkForUpdate
(String currentVersion) Checks for a new update and compares it against the current version.void
cleanUp()
This will close the childClassLoader
and mark all the resources held under this no longer in use, they will be cleaned up the next GC run.Returns the currently downloaded metrics version.boolean
Returns if the current server has metrics auto-updates enabled.void
start()
This method loads the metric module and starts the metrics collection.
-
Constructor Details
-
MetricsService
This constructs a new instance of ourMetricsService
.- Parameters:
plugin
- OurSlimefun
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 childClassLoader
and mark all the resources held under this no longer in use, they will be cleaned up the next GC run. -
checkForUpdate
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
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.
-