Package net.pl3x.map.core.metrics
Class Metrics.MetricsBase
java.lang.Object
net.pl3x.map.core.metrics.Metrics.MetricsBase
- Enclosing class:
Metrics
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetricsBase
(String platform, String serverUuid, 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. -
Method Summary
-
Field Details
-
METRICS_VERSION
- See Also:
-
-
Constructor Details
-
MetricsBase
public MetricsBase(String platform, String serverUuid, 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.- Parameters:
platform
- The platform of the service.serverUuid
- The server uuid.enabled
- Whether data sending is enabled.appendPlatformDataConsumer
- A consumer that receives aJsonObjectBuilder
and appends all platform-specific data.appendServiceDataConsumer
- A consumer that receives aJsonObjectBuilder
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 another thread to prevent errors caused by concurrency. Can benull
.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 errors should be logged.logSentData
- Whether the data sent should be logged.logResponseStatusText
- Whether the response status text should be logged.
-
-
Method Details
-
addCustomChart
-
shutdown
public void shutdown()
-