From a85cab726150a837dccfe09abaedb87f32b849cb Mon Sep 17 00:00:00 2001 From: SirYwell Date: Tue, 10 Jan 2023 08:58:51 +0100 Subject: [PATCH] Revert "Add JFR events" This reverts commit 78c107f1 --- .../plotsquared/core/command/HomeCommand.java | 14 --------- .../java/com/plotsquared/core/plot/Plot.java | 31 ------------------- 2 files changed, 45 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java index 4c523db31..2218ba44e 100644 --- a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java @@ -35,9 +35,6 @@ import com.plotsquared.core.util.query.PlotQuery; import com.plotsquared.core.util.query.SortingStrategy; import com.plotsquared.core.util.task.RunnableVal2; import com.plotsquared.core.util.task.RunnableVal3; -import jdk.jfr.Category; -import jdk.jfr.Event; -import jdk.jfr.Label; import net.kyori.adventure.text.minimessage.Template; import org.checkerframework.checker.nullness.qual.NonNull; @@ -62,24 +59,13 @@ public class HomeCommand extends Command { this.plotAreaManager = plotAreaManager; } - @Label("Home Query") - @Category("PlotSquared") - static class HomeQueryEvent extends Event { - @Label("Result Size") - public int size; - } - private void home( final @NonNull PlotPlayer player, final @NonNull PlotQuery query, final int page, final RunnableVal3 confirm, final RunnableVal2 whenDone ) { - final HomeQueryEvent event = new HomeQueryEvent(); - event.begin(); List plots = query.asList(); - event.size = plots.size(); - event.commit(); if (plots.isEmpty()) { player.sendMessage(TranslatableCaption.of("invalid.found_no_plots")); return; diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index 412268913..bab1a3d61 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -68,9 +68,6 @@ import com.plotsquared.core.util.task.TaskTime; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.biome.BiomeType; -import jdk.jfr.Category; -import jdk.jfr.Event; -import jdk.jfr.Label; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.minimessage.MiniMessage; @@ -2297,25 +2294,6 @@ public class Plot { return this.area.getPlotAbs(this.id.getRelative(direction)); } - @Label("Connected Plots Search") - @Category("PlotSquared") - static class ConnectedPlotsEvent extends Event { - - public ConnectedPlotsEvent(final int x, final int y) { - this.x = x; - this.y = y; - } - - @Label("Plot Id X") - public int x; - @Label("Plot Id Y") - public int y; - @Label("Merged Plots Count") - public int mergedSize; - @Label("Connected Plots Cache Miss") - public boolean cacheMiss; - } - /** * Gets a set of plots connected (and including) this plot
* - This result is cached globally @@ -2323,19 +2301,13 @@ public class Plot { * @return a Set of Plots connected to this Plot */ public Set getConnectedPlots() { - ConnectedPlotsEvent event = new ConnectedPlotsEvent(this.id.getX(), this.id.getY()); - event.begin(); if (this.settings == null) { - event.commit(); return Collections.singleton(this); } if (!this.isMerged()) { - event.commit(); return Collections.singleton(this); } if (this.connectedCache != null && this.connectedCache.contains(this)) { - event.mergedSize = this.connectedCache.size(); - event.commit(); return this.connectedCache; } @@ -2443,9 +2415,6 @@ public class Plot { } } this.connectedCache = tmpSet; - event.mergedSize = tmpSet.size(); - event.cacheMiss = true; - event.commit(); return tmpSet; }