Skip to content

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.

inline endstone::Metrics::Metrics (
    Plugin & plugin,
    int service_id
) 

Parameters:


function addCustomChart

Adds a custom chart.

inline void endstone::Metrics::addCustomChart (
    std::unique_ptr< CustomChart > chart
) 

Parameters:

  • chart the chart to add

function shutdown

Stops collecting and submitting data.

inline void endstone::Metrics::shutdown () noexcept

Repeated calls have no effect.



The documentation for this class was generated from the following file include/endstone/metrics/metrics.h