From bd5056787953c0d59a3bab133d1c4eba7e2d398e Mon Sep 17 00:00:00 2001 From: Luck Date: Fri, 2 Nov 2018 20:02:58 +0000 Subject: Add --without-gc flag (#7) --- .../me/lucko/spark/common/command/modules/MonitoringModule.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'spark-common/src/main/java/me/lucko/spark/common/command') diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/MonitoringModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/MonitoringModule.java index a6a227f..5d4d84c 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/MonitoringModule.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/MonitoringModule.java @@ -43,6 +43,7 @@ public class MonitoringModule implements CommandModule { consumer.accept(Command.builder() .aliases("monitoring") .argumentUsage("threshold", "percentage increase") + .argumentUsage("without-gc", null) .executor((platform, sender, arguments) -> { if (this.activeTickMonitor == null) { @@ -53,7 +54,7 @@ public class MonitoringModule implements CommandModule { try { TickCounter tickCounter = platform.newTickCounter(); - this.activeTickMonitor = new ReportingTickMonitor(platform, tickCounter, threshold); + this.activeTickMonitor = new ReportingTickMonitor(platform, tickCounter, threshold, !arguments.boolFlag("without-gc")); } catch (UnsupportedOperationException e) { platform.sendPrefixedMessage(sender, "&cNot supported!"); } @@ -78,8 +79,8 @@ public class MonitoringModule implements CommandModule { private class ReportingTickMonitor extends TickMonitor { private final SparkPlatform platform; - ReportingTickMonitor(SparkPlatform platform, TickCounter tickCounter, int percentageChangeThreshold) { - super(tickCounter, percentageChangeThreshold); + ReportingTickMonitor(SparkPlatform platform, TickCounter tickCounter, int percentageChangeThreshold, boolean monitorGc) { + super(tickCounter, percentageChangeThreshold, monitorGc); this.platform = platform; } -- cgit