diff --git a/src/main/java/ru/ruscalworld/fabricexporter/FabricExporter.java b/src/main/java/ru/ruscalworld/fabricexporter/FabricExporter.java index fb027d1..26c63e2 100644 --- a/src/main/java/ru/ruscalworld/fabricexporter/FabricExporter.java +++ b/src/main/java/ru/ruscalworld/fabricexporter/FabricExporter.java @@ -59,7 +59,7 @@ public class FabricExporter implements ModInitializer { ServerLifecycleEvents.SERVER_STOPPING.register(server -> { this.getHttpServer().close(); - this.getMetricRegistry().getTimer().cancel(); + this.getMetricRegistry().getMetricUpdaterTimer().cancel(); }); instance = this; diff --git a/src/main/java/ru/ruscalworld/fabricexporter/MetricRegistry.java b/src/main/java/ru/ruscalworld/fabricexporter/MetricRegistry.java index 0ed7dc6..24603aa 100644 --- a/src/main/java/ru/ruscalworld/fabricexporter/MetricRegistry.java +++ b/src/main/java/ru/ruscalworld/fabricexporter/MetricRegistry.java @@ -15,18 +15,18 @@ public class MetricRegistry { private final FabricExporter exporter; private final List metrics = new ArrayList<>(); private final HashMap customMetrics = new HashMap<>(); - private final Timer timer; + private final Timer metricUpdaterTimer; public MetricRegistry(FabricExporter exporter) { this.exporter = exporter; - timer = new Timer(); + metricUpdaterTimer = new Timer("Metric Updater Timer"); } public void runUpdater() { MainConfig config = this.getExporter().getConfig(); MetricUpdater metricUpdater = new MetricUpdater(this.getExporter()); this.getMetrics().forEach(metricUpdater::registerMetric); - this.getTimer().schedule(metricUpdater, 1000, config.getUpdateInterval()); + this.getMetricUpdaterTimer().schedule(metricUpdater, 1000, config.getUpdateInterval()); } public void registerDefault() { @@ -79,8 +79,8 @@ public class MetricRegistry { return exporter; } - public Timer getTimer() { - return timer; + public Timer getMetricUpdaterTimer() { + return metricUpdaterTimer; } public HashMap getCustomMetrics() {