3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

Do not include task id in timings handler name

Plugins that spam use repeating task timers are filling up the CustomTimingHandler list, which can degrade performance over time
Considering Essentials does this, and many servers use Essentials... def need to stop this.
Dieser Commit ist enthalten in:
Aikar 2013-02-27 00:39:53 -05:00 committet von md_5
Ursprung 44927fdaa6
Commit b5230a3857
2 geänderte Dateien mit 14 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From 7d318ee4bf7783ec9bca927195e5ee11d4490964 Mon Sep 17 00:00:00 2001
From 9808bdb02bc1e375a8f809a3b8b553104b242daa Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 10 Jan 2013 00:18:11 -0500
Subject: [PATCH] Improved Timings System
@ -407,7 +407,7 @@ index 4aa2a19..6cb3e24 100644
public BiomeMeta a(EnumCreatureType enumcreaturetype, int i, int j, int k) {
diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
new file mode 100644
index 0000000..df837a3
index 0000000..dec3110
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
@@ -0,0 +1,111 @@
@ -455,18 +455,18 @@ index 0000000..df837a3
+ */
+ public static CustomTimingsHandler getPluginTaskTimings(BukkitTask task, long period) {
+ String plugin = task.getOwner().getDescription().getFullName();
+ String name = "Task: " + plugin +" Id:";
+ if (period > 0) {
+ String name = "Task: " + plugin +" Id:(interval:" + period + ":id:"+task.getTaskId()+")";
+ return new CustomTimingsHandler(name);
+ name += "(interval:" + period +")";
+ } else {
+ String name = "Task: " + plugin + " Id:(Single)";
+ CustomTimingsHandler result = pluginTaskTimingMap.get(name);
+ if (result == null) {
+ result = new CustomTimingsHandler(name);
+ pluginTaskTimingMap.put(name, result);
+ }
+ return result;
+ name += "(Single)";
+ }
+ CustomTimingsHandler result = pluginTaskTimingMap.get(name);
+ if (result == null) {
+ result = new CustomTimingsHandler(name);
+ pluginTaskTimingMap.put(name, result);
+ }
+ return result;
+ }
+
+ /**

Datei anzeigen

@ -1,4 +1,4 @@
From 9f7d30b2630ab0b4f7f3f650456f08dd6c6409b6 Mon Sep 17 00:00:00 2001
From ef3c54902fe9772967964f6c7ad03b9d4d803379 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 14 Feb 2013 17:32:20 +1100
Subject: [PATCH] Netty
@ -223,7 +223,7 @@ index 58d30eb..e4e5049 100644
// CraftBukkit end
this.pendingConnection = pendingconnection;
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
index 6f54f7e..2ba6c14 100644
index c0335fa..8ecaeeb 100644
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -23,6 +23,8 @@ public class Spigot {
@ -235,7 +235,7 @@ index 6f54f7e..2ba6c14 100644
public static void initialize(CraftServer server, SimpleCommandMap commandMap, YamlConfiguration configuration) {
commandMap.register("bukkit", new org.bukkit.craftbukkit.command.TicksPerSecondCommand("tps"));
@@ -58,6 +60,12 @@ public class Spigot {
@@ -60,6 +62,12 @@ public class Spigot {
tabPing = configuration.getBoolean("settings.tab-ping", tabPing);