diff options
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/command')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java index 08233db..64c2fba 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java @@ -48,6 +48,8 @@ import java.util.function.Consumer; public class HealthModule implements CommandModule { + private static final int MSPT_95_PERCENTILE = 95; + @Override public void registerCommands(Consumer<Command> consumer) { consumer.accept(Command.builder() @@ -67,10 +69,9 @@ public class HealthModule implements CommandModule { resp.replyPrefixed(TextComponent.empty()); if (tickStatistics.isDurationSupported()) { - resp.replyPrefixed(TextComponent.of("Tick durations (avg/min/max ms) from last 5s, 10s, 1m:")); + resp.replyPrefixed(TextComponent.of("Tick durations (min/med/95%ile/max ms) from last 10s, 1m:")); resp.replyPrefixed(TextComponent.builder(" ") - .append(formatTickDurations(tickStatistics.duration5Sec())).append(TextComponent.of(", ")) - .append(formatTickDurations(tickStatistics.duration10Sec())).append(TextComponent.of(", ")) + .append(formatTickDurations(tickStatistics.duration10Sec())).append(TextComponent.of("; ")) .append(formatTickDurations(tickStatistics.duration1Min())) .build() ); @@ -129,12 +130,11 @@ public class HealthModule implements CommandModule { report.add(TextComponent.builder("") .append(TextComponent.builder(">").color(TextColor.DARK_GRAY).decoration(TextDecoration.BOLD, true).build()) .append(TextComponent.space()) - .append(TextComponent.of("Tick durations (avg/min/max ms) from last 5s, 10s, 1m:", TextColor.GOLD)) + .append(TextComponent.of("Tick durations (min/med/95%ile/max ms) from last 10s, 1m:", TextColor.GOLD)) .build() ); report.add(TextComponent.builder(" ") - .append(formatTickDurations(tickStatistics.duration5Sec())).append(TextComponent.of(", ")) - .append(formatTickDurations(tickStatistics.duration10Sec())).append(TextComponent.of(", ")) + .append(formatTickDurations(tickStatistics.duration10Sec())).append(TextComponent.of("; ")) .append(formatTickDurations(tickStatistics.duration1Min())) .build() ); @@ -299,10 +299,12 @@ public class HealthModule implements CommandModule { public static TextComponent formatTickDurations(RollingAverage average){ return TextComponent.builder("") - .append(formatTickDuration(average.getAverage())) - .append(TextComponent.of('/', TextColor.GRAY)) .append(formatTickDuration(average.getMin())) .append(TextComponent.of('/', TextColor.GRAY)) + .append(formatTickDuration(average.getMedian())) + .append(TextComponent.of('/', TextColor.GRAY)) + .append(formatTickDuration(average.getPercentile(MSPT_95_PERCENTILE))) + .append(TextComponent.of('/', TextColor.GRAY)) .append(formatTickDuration(average.getMax())) .build(); } |