Make separate metrics for min and max MSPT
This commit is contained in:
parent
0961890d47
commit
a48d73c30a
2 changed files with 8 additions and 4 deletions
|
@ -7,13 +7,17 @@ import ru.ruscalworld.fabricexporter.FabricExporter;
|
||||||
|
|
||||||
public class MillisPerTick extends SparkMetric {
|
public class MillisPerTick extends SparkMetric {
|
||||||
public MillisPerTick() {
|
public MillisPerTick() {
|
||||||
super("mspt", "Milliseconds per tick (MSPT)");
|
super("mspt", "Milliseconds per tick (MSPT)", "type");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(FabricExporter exporter) {
|
public void update(FabricExporter exporter) {
|
||||||
GenericStatistic<DoubleAverageInfo, StatisticWindow.MillisPerTick> mspt = this.getSpark().mspt();
|
GenericStatistic<DoubleAverageInfo, StatisticWindow.MillisPerTick> mspt = this.getSpark().mspt();
|
||||||
if (mspt == null) this.getGauge().set(0);
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ import me.lucko.spark.api.Spark;
|
||||||
import me.lucko.spark.api.SparkProvider;
|
import me.lucko.spark.api.SparkProvider;
|
||||||
|
|
||||||
public abstract class SparkMetric extends Metric {
|
public abstract class SparkMetric extends Metric {
|
||||||
public SparkMetric(String name, String help) {
|
public SparkMetric(String name, String help, String... labels) {
|
||||||
super(name, help);
|
super(name, help, labels);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Spark getSpark() {
|
public Spark getSpark() {
|
||||||
|
|
Loading…
Reference in a new issue