Class Metrics.MetricsBase

java.lang.Object
net.pl3x.map.core.metrics.Metrics.MetricsBase
Enclosing class:
Metrics

public static class Metrics.MetricsBase extends Object
  • Field Details

  • Constructor Details

    • MetricsBase

      public MetricsBase(@NotNull @NotNull String platform, @NotNull @NotNull String serverUuid, boolean enabled, @NotNull @NotNull Consumer<@NotNull Metrics.JsonObjectBuilder> appendPlatformDataConsumer, @NotNull @NotNull Consumer<@NotNull Metrics.JsonObjectBuilder> appendServiceDataConsumer, @NotNull @NotNull Consumer<@NotNull Runnable> submitTaskConsumer, @NotNull @NotNull Supplier<@NotNull Boolean> checkServiceEnabledSupplier, @NotNull @NotNull BiConsumer<@NotNull String,@NotNull Throwable> errorLogger, @NotNull @NotNull Consumer<@NotNull 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 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 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 errors should be logged.
      logSentData - Whether the data sent should be logged.
      logResponseStatusText - Whether the response status text should be logged.
  • Method Details

    • addCustomChart

      public void addCustomChart(@NotNull @NotNull Metrics.CustomChart chart)
    • shutdown

      public void shutdown()