Class bStats.MetricsBase

java.lang.Object
io.github.lucfr1746.llibrary.metrics.bStats.MetricsBase
Enclosing class:
bStats

public static class bStats.MetricsBase extends Object
  • Field Details

  • Constructor Details

    • MetricsBase

      public MetricsBase(String platform, String serverUuid, int serviceId, boolean enabled, Consumer<bStats.JsonObjectBuilder> appendPlatformDataConsumer, Consumer<bStats.JsonObjectBuilder> appendServiceDataConsumer, Consumer<Runnable> submitTaskConsumer, Supplier<Boolean> checkServiceEnabledSupplier, BiConsumer<String,Throwable> errorLogger, Consumer<String> infoLogger, boolean logErrors, boolean logSentData, boolean logResponseStatusText, boolean skipRelocateCheck)
      Creates a new MetricsBase class instance.
      Parameters:
      platform - The platform of the service.
      serverUuid - The server uuid.
      serviceId - The id of the service.
      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 scent data should be logged.
      logResponseStatusText - Whether the response status text should be logged.
      skipRelocateCheck - Whether the relocated check should be skipped.
  • Method Details

    • addCustomChart

      public void addCustomChart(bStats.CustomChart chart)
    • shutdown

      public void shutdown()