diff options
author | Luck <git@lucko.me> | 2020-02-04 00:49:40 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2020-02-04 00:49:40 +0000 |
commit | e02d52ce8d45550a4d77f11971e31cf0732e5f0c (patch) | |
tree | cfcfb2850ff6b279276e43233e5e1acf82993a98 /spark-sponge/src/main/java/me | |
parent | d15a12788ddc8aba09f49003fcef55b927850de3 (diff) | |
download | spark-e02d52ce8d45550a4d77f11971e31cf0732e5f0c.tar.gz spark-e02d52ce8d45550a4d77f11971e31cf0732e5f0c.tar.bz2 spark-e02d52ce8d45550a4d77f11971e31cf0732e5f0c.zip |
Monitor average tick durations & report them in /spark tps
Diffstat (limited to 'spark-sponge/src/main/java/me')
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java | 9 | ||||
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickHook.java (renamed from spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java) | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java index d221f04..ae0efef 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java @@ -24,7 +24,7 @@ import com.google.inject.Inject; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; import me.lucko.spark.common.sampler.ThreadDumper; -import me.lucko.spark.common.sampler.TickCounter; +import me.lucko.spark.common.sampler.tick.TickHook; import org.spongepowered.api.Game; import org.spongepowered.api.command.CommandCallable; import org.spongepowered.api.command.CommandResult; @@ -41,12 +41,13 @@ import org.spongepowered.api.text.Text; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; -import javax.annotation.Nullable; import java.nio.file.Path; import java.util.List; import java.util.Optional; import java.util.stream.Stream; +import javax.annotation.Nullable; + @Plugin( id = "spark", name = "spark", @@ -119,8 +120,8 @@ public class SpongeSparkPlugin implements SparkPlugin { } @Override - public TickCounter createTickCounter() { - return new SpongeTickCounter(this); + public TickHook createTickHook() { + return new SpongeTickHook(this); } private static final class SparkCommand implements CommandCallable { diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickHook.java index d7823b1..2fdc459 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickHook.java @@ -20,15 +20,15 @@ package me.lucko.spark.sponge; -import me.lucko.spark.common.sampler.AbstractTickCounter; -import me.lucko.spark.common.sampler.TickCounter; +import me.lucko.spark.common.sampler.tick.AbstractTickHook; +import me.lucko.spark.common.sampler.tick.TickHook; import org.spongepowered.api.scheduler.Task; -public class SpongeTickCounter extends AbstractTickCounter implements TickCounter, Runnable { +public class SpongeTickHook extends AbstractTickHook implements TickHook, Runnable { private final SpongeSparkPlugin plugin; private Task task; - public SpongeTickCounter(SpongeSparkPlugin plugin) { + public SpongeTickHook(SpongeSparkPlugin plugin) { this.plugin = plugin; } |