aboutsummaryrefslogtreecommitdiff
path: root/spark-fabric/src
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2020-02-04 00:49:40 +0000
committerLuck <git@lucko.me>2020-02-04 00:49:40 +0000
commite02d52ce8d45550a4d77f11971e31cf0732e5f0c (patch)
treecfcfb2850ff6b279276e43233e5e1acf82993a98 /spark-fabric/src
parentd15a12788ddc8aba09f49003fcef55b927850de3 (diff)
downloadspark-e02d52ce8d45550a4d77f11971e31cf0732e5f0c.tar.gz
spark-e02d52ce8d45550a4d77f11971e31cf0732e5f0c.tar.bz2
spark-e02d52ce8d45550a4d77f11971e31cf0732e5f0c.zip
Monitor average tick durations & report them in /spark tps
Diffstat (limited to 'spark-fabric/src')
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickHook.java (renamed from spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickCounter.java)10
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java8
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java8
3 files changed, 13 insertions, 13 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickCounter.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickHook.java
index 7781e03..17c286f 100644
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickCounter.java
+++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricTickHook.java
@@ -20,14 +20,14 @@
package me.lucko.spark.fabric;
-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 net.fabricmc.fabric.api.event.client.ClientTickCallback;
import net.fabricmc.fabric.api.event.server.ServerTickCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.server.MinecraftServer;
-public abstract class FabricTickCounter extends AbstractTickCounter implements TickCounter {
+public abstract class FabricTickHook extends AbstractTickHook implements TickHook {
protected boolean closed = false;
@@ -36,7 +36,7 @@ public abstract class FabricTickCounter extends AbstractTickCounter implements T
this.closed = true;
}
- public static final class Server extends FabricTickCounter implements ServerTickCallback {
+ public static final class Server extends FabricTickHook implements ServerTickCallback {
@Override
public void tick(MinecraftServer minecraftServer) {
if (!this.closed) {
@@ -50,7 +50,7 @@ public abstract class FabricTickCounter extends AbstractTickCounter implements T
}
}
- public static final class Client extends FabricTickCounter implements ClientTickCallback {
+ public static final class Client extends FabricTickHook implements ClientTickCallback {
@Override
public void tick(MinecraftClient minecraftClient) {
if (!this.closed) {
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java
index 8cacc62..88454a8 100644
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java
+++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java
@@ -27,11 +27,11 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.suggestion.SuggestionProvider;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
-import me.lucko.spark.common.sampler.TickCounter;
+import me.lucko.spark.common.sampler.tick.TickHook;
import me.lucko.spark.fabric.FabricCommandSender;
import me.lucko.spark.fabric.FabricSparkGameHooks;
import me.lucko.spark.fabric.FabricSparkMod;
-import me.lucko.spark.fabric.FabricTickCounter;
+import me.lucko.spark.fabric.FabricTickHook;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.server.command.CommandOutput;
@@ -122,8 +122,8 @@ public class FabricClientSparkPlugin extends FabricSparkPlugin implements Sugges
}
@Override
- public TickCounter createTickCounter() {
- return new FabricTickCounter.Client();
+ public TickHook createTickHook() {
+ return new FabricTickHook.Client();
}
@Override
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java
index 6399198..5db40af 100644
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java
+++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java
@@ -26,10 +26,10 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.suggestion.SuggestionProvider;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
-import me.lucko.spark.common.sampler.TickCounter;
+import me.lucko.spark.common.sampler.tick.TickHook;
import me.lucko.spark.fabric.FabricCommandSender;
import me.lucko.spark.fabric.FabricSparkMod;
-import me.lucko.spark.fabric.FabricTickCounter;
+import me.lucko.spark.fabric.FabricTickHook;
import net.fabricmc.fabric.api.registry.CommandRegistry;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.MinecraftServer;
@@ -111,8 +111,8 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman
}
@Override
- public TickCounter createTickCounter() {
- return new FabricTickCounter.Server();
+ public TickHook createTickHook() {
+ return new FabricTickHook.Server();
}
@Override