Class endstone::Metrics¶
ClassList > endstone > Metrics
Collects and submits anonymous usage statistics for a plugin to bStats. More...
#include <endstone/metrics/metrics.h>
Public Functions¶
| Type | Name |
|---|---|
| Metrics (Plugin & plugin, int service_id) Creates a new Metrics instance. |
|
| void | addCustomChart (std::unique_ptr< CustomChart > chart) Adds a custom chart. |
| void | shutdown () noexcept Stops collecting and submitting data. |
Detailed Description¶
The server owns the metrics behind this handle and retires them when it reloads or shuts down, so a plugin may add its charts in Plugin::onEnable and drop the handle. Asking twice for the same service id gives back the same metrics.
Public Functions Documentation¶
function Metrics¶
Creates a new Metrics instance.
Parameters:
pluginthe plugin these metrics belong toservice_idthe id of the service, found at https://bstats.org/what-is-my-plugin-id
function addCustomChart¶
Adds a custom chart.
Parameters:
chartthe chart to add
function shutdown¶
Stops collecting and submitting data.
Repeated calls have no effect.
The documentation for this class was generated from the following file include/endstone/metrics/metrics.h