Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Timings #11122

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 70 additions & 32 deletions patches/api/0011-Timings-v2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ expose isRunning

diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..36b8fe86335df851f9c85d6bb2a91368b4d945d1
index 0000000000000000000000000000000000000000..3e747abde6fefae90f1c15cb00158bc5303cbe50
--- /dev/null
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
@@ -0,0 +1,86 @@
@@ -0,0 +1,89 @@
+package co.aikar.timings;
+
+import static co.aikar.timings.TimingsManager.*;
+
+import org.bukkit.Bukkit;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+public class FullServerTickHandler extends TimingHandler {
+ private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null);
Expand Down Expand Up @@ -100,10 +103,10 @@ index 0000000000000000000000000000000000000000..36b8fe86335df851f9c85d6bb2a91368
+}
diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..81671cf40feeed2844ee8d92348d48062aaf2c46
index 0000000000000000000000000000000000000000..42e7e712403676171d34d5f2be27e48e7a071ebd
--- /dev/null
+++ b/src/main/java/co/aikar/timings/NullTimingHandler.java
@@ -0,0 +1,69 @@
@@ -0,0 +1,72 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
Expand Down Expand Up @@ -132,6 +135,9 @@ index 0000000000000000000000000000000000000000..81671cf40feeed2844ee8d92348d4806
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+public final class NullTimingHandler implements Timing {
+ public static final Timing NULL = new NullTimingHandler();
Expand Down Expand Up @@ -175,10 +181,10 @@ index 0000000000000000000000000000000000000000..81671cf40feeed2844ee8d92348d4806
+}
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
new file mode 100644
index 0000000000000000000000000000000000000000..be275c25664e0c76123371c6c8fac601f87fa492
index 0000000000000000000000000000000000000000..a3ad690691eb5537a565d7ba684354acfec5ee2d
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java
@@ -0,0 +1,84 @@
@@ -0,0 +1,87 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
Expand Down Expand Up @@ -215,6 +221,9 @@ index 0000000000000000000000000000000000000000..be275c25664e0c76123371c6c8fac601
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+public class TimedEventExecutor implements EventExecutor {
+
Expand Down Expand Up @@ -265,7 +274,7 @@ index 0000000000000000000000000000000000000000..be275c25664e0c76123371c6c8fac601
+}
diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java
new file mode 100644
index 0000000000000000000000000000000000000000..7514fad26f955329f8bf17ff17db75f0c8301ee5
index 0000000000000000000000000000000000000000..4195efcfe044618052bb03dea34a4fb2ca7c44f0
--- /dev/null
+++ b/src/main/java/co/aikar/timings/Timing.java
@@ -0,0 +1,86 @@
Expand Down Expand Up @@ -300,7 +309,7 @@ index 0000000000000000000000000000000000000000..7514fad26f955329f8bf17ff17db75f0
+/**
+ * Provides an ability to time sections of code within the Minecraft Server
+ *
+ * @deprecated Timings will likely be replaced with Spark in the future
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+public interface Timing extends AutoCloseable {
Expand Down Expand Up @@ -717,10 +726,10 @@ index 0000000000000000000000000000000000000000..199789d56d22fcb1b77ebd56805cc28a
+}
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
new file mode 100644
index 0000000000000000000000000000000000000000..065991e7a7f6119797ea315a56836ba17dd17d05
index 0000000000000000000000000000000000000000..3d4390f263e52aafa24b306b1fd20d088a4ffcd7
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
@@ -0,0 +1,352 @@
@@ -0,0 +1,357 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
Expand Down Expand Up @@ -773,6 +782,11 @@ index 0000000000000000000000000000000000000000..065991e7a7f6119797ea315a56836ba1
+import static co.aikar.timings.TimingsManager.MINUTE_REPORTS;
+import static co.aikar.util.JSONUtil.*;
+
+/**
+ * Internal.
+ *
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+@SuppressWarnings({"deprecation", "SuppressionAnnotation", "Convert2Lambda", "Anonymous2MethodRef"})
+public class TimingHistory {
Expand Down Expand Up @@ -1261,7 +1275,7 @@ index 0000000000000000000000000000000000000000..df142a89b8c43acb81eb383eac0ef048
+}
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
new file mode 100644
index 0000000000000000000000000000000000000000..445b5d3b61f31cf263475d0155a7b0252c54a3f8
index 0000000000000000000000000000000000000000..e81d0bc309de877ed2b5da6122f55c162e9b5f10
--- /dev/null
+++ b/src/main/java/co/aikar/timings/Timings.java
@@ -0,0 +1,331 @@
Expand Down Expand Up @@ -1308,7 +1322,7 @@ index 0000000000000000000000000000000000000000..445b5d3b61f31cf263475d0155a7b025
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @deprecated Timings will likely be replaced with Spark in the future
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+@SuppressWarnings({"UnusedDeclaration", "WeakerAccess", "SameParameterValue"})
Expand Down Expand Up @@ -1598,10 +1612,10 @@ index 0000000000000000000000000000000000000000..445b5d3b61f31cf263475d0155a7b025
+
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..e801e79fa57c44b2e5d359647c920f88064826f1
index 0000000000000000000000000000000000000000..95d87c9dbf2b237787294dfbe7fed87a36e6dedf
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
@@ -0,0 +1,124 @@
@@ -0,0 +1,126 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
Expand Down Expand Up @@ -1640,7 +1654,9 @@ index 0000000000000000000000000000000000000000..e801e79fa57c44b2e5d359647c920f88
+
+import static net.kyori.adventure.text.Component.text;
+
+
+/**
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+public class TimingsCommand extends BukkitCommand {
+ private static final List<String> TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste", "verbon", "verboff");
Expand Down Expand Up @@ -1728,7 +1744,7 @@ index 0000000000000000000000000000000000000000..e801e79fa57c44b2e5d359647c920f88
+}
diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..5e1558ca3ffeeaf2645fa003965474a442d650bf
index 0000000000000000000000000000000000000000..e72ad05abada04426e32a73d02b21cb69079d268
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsManager.java
@@ -0,0 +1,192 @@
Expand Down Expand Up @@ -1774,7 +1790,7 @@ index 0000000000000000000000000000000000000000..5e1558ca3ffeeaf2645fa003965474a4
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @deprecated Timings will likely be replaced with Spark in the future
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+public final class TimingsManager {
Expand Down Expand Up @@ -1926,10 +1942,10 @@ index 0000000000000000000000000000000000000000..5e1558ca3ffeeaf2645fa003965474a4
+}
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
new file mode 100644
index 0000000000000000000000000000000000000000..3af5b8ea795311582044c712de50d29412024b77
index 0000000000000000000000000000000000000000..df066d6f8d55afbc0c1897c486d638657a5f8df9
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -0,0 +1,87 @@
@@ -0,0 +1,90 @@
+package co.aikar.timings;
+
+import com.google.common.base.Preconditions;
Expand All @@ -1944,6 +1960,9 @@ index 0000000000000000000000000000000000000000..3af5b8ea795311582044c712de50d294
+
+import java.util.List;
+
+/**
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+@SuppressWarnings("WeakerAccess")
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
Expand Down Expand Up @@ -2888,40 +2907,48 @@ index fa6ad07214d5e38866bf6bee9139c6c938e9f51a..57c9b560c77a56588870598acb543469
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index d8b346fe0f9634218954fe818d53272a0896af9c..7545e3489474aab3f935095c6057ea2eac1bf84b 100644
index d8b346fe0f9634218954fe818d53272a0896af9c..12ef99f1c91b92a133611c5f5aeaaeebd02ce232 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -40,6 +40,7 @@ public interface UnsafeValues {
@@ -40,6 +40,11 @@ public interface UnsafeValues {
net.kyori.adventure.text.Component resolveWithContext(net.kyori.adventure.text.Component component, org.bukkit.command.CommandSender context, org.bukkit.entity.Entity scoreboardSubject, boolean bypassPermissions) throws java.io.IOException;
// Paper end

+ /**
+ * @deprecated Timings will be removed in the future
+ */
+ @Deprecated(forRemoval = true)
+ void reportTimings(); // Paper
Material toLegacy(Material material);

Material fromLegacy(Material material);
@@ -151,4 +152,12 @@ public interface UnsafeValues {
@@ -151,4 +156,12 @@ public interface UnsafeValues {
return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
}
// Paper end
+
+ // Paper start
+ /**
+ * Server name to report to timings v2
+ * @return name
+ * @deprecated Timings will be removed in the future
+ */
+ @Deprecated(forRemoval = true)
+ String getTimingsServerName();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/BufferedCommandSender.java b/src/main/java/org/bukkit/command/BufferedCommandSender.java
new file mode 100644
index 0000000000000000000000000000000000000000..f9a00aecca5ec41b460bf41dfe1c69694768cf98
index 0000000000000000000000000000000000000000..45ed63797b13e114bf3795c80a6c3967d8eb2351
--- /dev/null
+++ b/src/main/java/org/bukkit/command/BufferedCommandSender.java
@@ -0,0 +1,21 @@
@@ -0,0 +1,25 @@
+package org.bukkit.command;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+public class BufferedCommandSender implements MessageCommandSender {
+ private final StringBuffer buffer = new StringBuffer();
+ @Override
Expand All @@ -2940,28 +2967,36 @@ index 0000000000000000000000000000000000000000..f9a00aecca5ec41b460bf41dfe1c6969
+ }
+}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index f3cdf13f22aa789ee8cc235b61fda4035b254219..33c0a60e71f4bd29966c10ea60b22f14e56c1de4 100644
index f3cdf13f22aa789ee8cc235b61fda4035b254219..17d3da22e8fcdf73a587b17a0cdac3b23ded3567 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -33,7 +33,8 @@ public abstract class Command {
@@ -33,7 +33,16 @@ public abstract class Command {
protected String usageMessage;
private String permission;
private net.kyori.adventure.text.Component permissionMessage; // Paper
- public org.spigotmc.CustomTimingsHandler timings; // Spigot
+ /**
+ * @deprecated Timings will be removed in the future
+ */
+ @Deprecated(forRemoval = true)
+ public co.aikar.timings.Timing timings; // Paper
+ /**
+ * @deprecated Timings will be removed in the future
+ */
+ @Deprecated(forRemoval = true)
+ @NotNull public String getTimingName() {return getName();} // Paper

protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
@@ -47,7 +48,6 @@ public abstract class Command {
@@ -47,7 +56,6 @@ public abstract class Command {
this.usageMessage = (usageMessage == null) ? "/" + name : usageMessage;
this.aliases = aliases;
this.activeAliases = new ArrayList<String>(aliases);
- this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot
}

/**
@@ -245,7 +245,6 @@ public abstract class Command {
@@ -245,7 +253,6 @@ public abstract class Command {
}
this.nextLabel = name;
if (!isRegistered()) {
Expand Down Expand Up @@ -2994,10 +3029,10 @@ index d6c8938b1e13b63116b7b0e074ea8ef5997f8dc3..a6ad94ef98a1df1d2842635d850bc990
}
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
new file mode 100644
index 0000000000000000000000000000000000000000..9d263ab3afb938c215c0b64d9171345fca6ceb2c
index 0000000000000000000000000000000000000000..946d2f0ef37c6cf895caf8d3c6963c7889e0567b
--- /dev/null
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
@@ -0,0 +1,135 @@
@@ -0,0 +1,138 @@
+package org.bukkit.command;
+
+import org.bukkit.Bukkit;
Expand All @@ -3015,7 +3050,10 @@ index 0000000000000000000000000000000000000000..9d263ab3afb938c215c0b64d9171345f
+
+/**
+ * For when all you care about is just messaging
+ *
+ * @deprecated Timings will be removed in the future
+ */
+@Deprecated(forRemoval = true)
+public interface MessageCommandSender extends CommandSender {
+
+ @Override
Expand Down
6 changes: 3 additions & 3 deletions patches/api/0015-Expose-server-build-information.patch
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,12 @@ index ba28d9f3213ca4b5f15178dc637bff37a8896edc..8a07f21eeb04fb54032ce377a1478f60
* Gets a view of all currently logged in players. This {@linkplain
* Collections#unmodifiableCollection(Collection) view} is a reused
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 7545e3489474aab3f935095c6057ea2eac1bf84b..6def69b973a76a4cee5aee6431a6538e4c27377d 100644
index 12ef99f1c91b92a133611c5f5aeaaeebd02ce232..6e67fdb091a006d2d13bc2d93db4d55348af4c8f 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -159,5 +159,12 @@ public interface UnsafeValues {
* @return name
@@ -163,5 +163,12 @@ public interface UnsafeValues {
*/
@Deprecated(forRemoval = true)
String getTimingsServerName();
+
+ /**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ index ced9203c81477c802983df2f03b4e4efc517519b..0ba391e6a1e585f29930b4111421e99f
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 33c0a60e71f4bd29966c10ea60b22f14e56c1de4..f7b78198d9983610fc2185124c3080e6b1c0fa35 100644
index 17d3da22e8fcdf73a587b17a0cdac3b23ded3567..8a298b655f4eaf5116994f98572a20e83a23838c 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -99,7 +99,7 @@ public abstract class Command {
@@ -107,7 +107,7 @@ public abstract class Command {
Preconditions.checkArgument(args != null, "Arguments cannot be null");
Preconditions.checkArgument(alias != null, "Alias cannot be null");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Don't use snapshots for Timings Tile Entity reports


diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
index 065991e7a7f6119797ea315a56836ba17dd17d05..2d87237ea99d42c6ce896d52a1b2e5c3ec4d4568 100644
index 3d4390f263e52aafa24b306b1fd20d088a4ffcd7..6f6eb1a2e6c8d49014a7ae44540ee282bae5200e 100644
--- a/src/main/java/co/aikar/timings/TimingHistory.java
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
@@ -120,7 +120,7 @@ public class TimingHistory {
@@ -125,7 +125,7 @@ public class TimingHistory {
data.entityCounts.get(entity.getType()).increment();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ index 5c6c9f714097dfaead0093d752f1b373b70a75eb..08f6f85388e4c3e3aae40f709109f870
* Creates a PlayerProfile for the specified uuid, with name as null.
*
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index f7b78198d9983610fc2185124c3080e6b1c0fa35..b3a2c274f05156fd603bcc7a68ab41265f2eaf44 100644
index 8a298b655f4eaf5116994f98572a20e83a23838c..03d2643d166824458c88a49f20270e93b14f3988 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -184,10 +184,9 @@ public abstract class Command {
@@ -192,10 +192,9 @@ public abstract class Command {
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions patches/api/0182-Add-Raw-Byte-ItemStack-Serialization.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format.

diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 6def69b973a76a4cee5aee6431a6538e4c27377d..601d7171d182f56442b1dcea8429737ef3909e84 100644
index 6e67fdb091a006d2d13bc2d93db4d55348af4c8f..e41d5d9b810c8816cd0d1eba5fd1ea56252fb0df 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -166,5 +166,9 @@ public interface UnsafeValues {
@@ -170,5 +170,9 @@ public interface UnsafeValues {
default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and


diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 601d7171d182f56442b1dcea8429737ef3909e84..460b94538a990a5d136c0c07166887940347c6e2 100644
index e41d5d9b810c8816cd0d1eba5fd1ea56252fb0df..64be4e60a03cb7cdc21013837d241d288695b69d 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -170,5 +170,12 @@ public interface UnsafeValues {
@@ -174,5 +174,12 @@ public interface UnsafeValues {
byte[] serializeItem(ItemStack item);

ItemStack deserializeItem(byte[] data);
Expand Down
Loading
Loading