diff --git a/src/main/java/ru/ruscalworld/fabricexporter/metrics/MillisPerTick.java b/src/main/java/ru/ruscalworld/fabricexporter/metrics/MillisPerTick.java index 6697437..252877f 100644 --- a/src/main/java/ru/ruscalworld/fabricexporter/metrics/MillisPerTick.java +++ b/src/main/java/ru/ruscalworld/fabricexporter/metrics/MillisPerTick.java @@ -7,13 +7,17 @@ import ru.ruscalworld.fabricexporter.FabricExporter; public class MillisPerTick extends SparkMetric { public MillisPerTick() { - super("mspt", "Milliseconds per tick (MSPT)"); + super("mspt", "Milliseconds per tick (MSPT)", "type"); } @Override public void update(FabricExporter exporter) { GenericStatistic mspt = this.getSpark().mspt(); if (mspt == null) this.getGauge().set(0); - else this.getGauge().set(mspt.poll(StatisticWindow.MillisPerTick.MINUTES_1).mean()); + else { + this.getGauge().labels("min").set(mspt.poll(StatisticWindow.MillisPerTick.MINUTES_1).min()); + this.getGauge().labels("mean").set(mspt.poll(StatisticWindow.MillisPerTick.MINUTES_1).mean()); + this.getGauge().labels("max").set(mspt.poll(StatisticWindow.MillisPerTick.MINUTES_1).max()); + } } } diff --git a/src/main/java/ru/ruscalworld/fabricexporter/metrics/SparkMetric.java b/src/main/java/ru/ruscalworld/fabricexporter/metrics/SparkMetric.java index 292ad0f..dc9cfe0 100644 --- a/src/main/java/ru/ruscalworld/fabricexporter/metrics/SparkMetric.java +++ b/src/main/java/ru/ruscalworld/fabricexporter/metrics/SparkMetric.java @@ -4,8 +4,8 @@ import me.lucko.spark.api.Spark; import me.lucko.spark.api.SparkProvider; public abstract class SparkMetric extends Metric { - public SparkMetric(String name, String help) { - super(name, help); + public SparkMetric(String name, String help, String... labels) { + super(name, help, labels); } public Spark getSpark() {