| Modifier and Type | Field and Description |
|---|---|
static String |
METRICS_VERSION
The version of the Metrics class.
|
| Constructor and Description |
|---|
MetricsBase(String platform,
String serverUuid,
int serviceId,
boolean enabled,
Consumer<Metrics.JsonObjectBuilder> appendPlatformDataConsumer,
Consumer<Metrics.JsonObjectBuilder> appendServiceDataConsumer,
Consumer<Runnable> submitTaskConsumer,
Supplier<Boolean> checkServiceEnabledSupplier,
BiConsumer<String,Throwable> errorLogger,
Consumer<String> infoLogger,
boolean logErrors,
boolean logSentData,
boolean logResponseStatusText)
Creates a new MetricsBase class instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCustomChart(Metrics.CustomChart chart) |
void |
shutdown() |
public static final String METRICS_VERSION
public MetricsBase(String platform, String serverUuid, int serviceId, boolean enabled, Consumer<Metrics.JsonObjectBuilder> appendPlatformDataConsumer, Consumer<Metrics.JsonObjectBuilder> appendServiceDataConsumer, Consumer<Runnable> submitTaskConsumer, Supplier<Boolean> checkServiceEnabledSupplier, BiConsumer<String,Throwable> errorLogger, Consumer<String> infoLogger, boolean logErrors, boolean logSentData, boolean logResponseStatusText)
platform - The platform of the service.serviceId - The id of the service.serverUuid - The server uuid.enabled - Whether or not data sending is enabled.appendPlatformDataConsumer - A consumer that receives a JsonObjectBuilder and
appends all platform-specific data.appendServiceDataConsumer - A consumer that receives a JsonObjectBuilder and
appends all service-specific data.submitTaskConsumer - A consumer that takes a runnable with the submit task. This can be
used to delegate the data collection to a another thread to prevent errors caused by
concurrency. Can be null.checkServiceEnabledSupplier - A supplier to check if the service is still enabled.errorLogger - A consumer that accepts log message and an error.infoLogger - A consumer that accepts info log messages.logErrors - Whether or not errors should be logged.logSentData - Whether or not the sent data should be logged.logResponseStatusText - Whether or not the response status text should be logged.public void addCustomChart(Metrics.CustomChart chart)
public void shutdown()
Copyright © 2015–2025 tr7zw. All rights reserved.