diff options
author | Luck <git@lucko.me> | 2018-11-02 20:02:58 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2018-11-02 20:02:58 +0000 |
commit | bd5056787953c0d59a3bab133d1c4eba7e2d398e (patch) | |
tree | e9cfff1647f61549e502eec9f964e6daaba4dfca /spark-common/src/main/java/me/lucko/spark/common | |
parent | 61f5addbb996f43d2044a4de12a8241584b8b65f (diff) | |
download | spark-bd5056787953c0d59a3bab133d1c4eba7e2d398e.tar.gz spark-bd5056787953c0d59a3bab133d1c4eba7e2d398e.tar.bz2 spark-bd5056787953c0d59a3bab133d1c4eba7e2d398e.zip |
Add --without-gc flag (#7)
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/command/modules/MonitoringModule.java | 7 |
1 files changed, 4 insertions, 3 deletions
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<S> implements CommandModule<S> { consumer.accept(Command.<S>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<S> implements CommandModule<S> { 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<S> implements CommandModule<S> { private class ReportingTickMonitor extends TickMonitor { private final SparkPlatform<S> platform; - ReportingTickMonitor(SparkPlatform<S> platform, TickCounter tickCounter, int percentageChangeThreshold) { - super(tickCounter, percentageChangeThreshold); + ReportingTickMonitor(SparkPlatform<S> platform, TickCounter tickCounter, int percentageChangeThreshold, boolean monitorGc) { + super(tickCounter, percentageChangeThreshold, monitorGc); this.platform = platform; } |