diff --git a/Spigot-API-Patches/0015-Timings-v2.patch b/Spigot-API-Patches/0015-Timings-v2.patch index 39c9907443..ccd8e62ed5 100644 --- a/Spigot-API-Patches/0015-Timings-v2.patch +++ b/Spigot-API-Patches/0015-Timings-v2.patch @@ -1,4 +1,4 @@ -From 32fbda75d86e0e21c17f414a6e01c1f51eb369a2 Mon Sep 17 00:00:00 2001 +From 4f9f4ee4270ba3bf65c69559bbd1e8157f70c78e Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 8 Jan 2016 23:12:28 -0600 Subject: [PATCH] Timings v2 @@ -263,7 +263,7 @@ index 0000000..e3da034 +} 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 0000000..2ac1237 +index 0000000..4d990b1 --- /dev/null +++ b/src/main/java/co/aikar/timings/Timing.java @@ -0,0 +1,72 @@ @@ -302,8 +302,8 @@ index 0000000..2ac1237 + public void startTiming(); + + /** -+ * Stops timing and records the data. Propagates the data up to group handlers. -+ *

++ *

Stops timing and records the data. Propagates the data up to group handlers.

++ * + * Will automatically be called when this Timing is used with try-with-resources + */ + public void stopTiming(); @@ -316,9 +316,9 @@ index 0000000..2ac1237 + public void startTimingIfSync(); + + /** -+ * Stops timing and records the data. Propagates the data up to group handlers. -+ *

-+ * Will automatically be called when this Timing is used with try-with-resources ++ *

Stops timing and records the data. Propagates the data up to group handlers.

++ * ++ *

Will automatically be called when this Timing is used with try-with-resources

+ * + * But only if we are on the primary thread. + */ @@ -341,7 +341,7 @@ index 0000000..2ac1237 +} diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java new file mode 100644 -index 0000000..6ad0ca6 +index 0000000..b62e428 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingData.java @@ -0,0 +1,105 @@ @@ -377,8 +377,8 @@ index 0000000..6ad0ca6 +import static co.aikar.util.JSONUtil.toArray; + +/** -+ * Lightweight object for tracking timing data -+ *

++ *

Lightweight object for tracking timing data

++ * + * This is broken out to reduce memory usage + */ +class TimingData { @@ -998,7 +998,7 @@ index 0000000..eac4e21 +} diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java new file mode 100644 -index 0000000..6084afe +index 0000000..623dda4 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingIdentifier.java @@ -0,0 +1,102 @@ @@ -1035,8 +1035,8 @@ index 0000000..6084afe +import java.util.Map; + +/** -+ * Used as a basis for fast HashMap key comparisons for the Timing Map. -+ *

++ *

Used as a basis for fast HashMap key comparisons for the Timing Map.

++ * + * This class uses interned strings giving us the ability to do an identity check instead of equals() on the strings + */ +final class TimingIdentifier { @@ -1106,7 +1106,7 @@ index 0000000..6084afe +} 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 0000000..e51e232 +index 0000000..0f7be03 --- /dev/null +++ b/src/main/java/co/aikar/timings/Timings.java @@ -0,0 +1,273 @@ @@ -1172,10 +1172,10 @@ index 0000000..e51e232 + } + + /** -+ * Returns a handler that has a groupHandler timer handler. Parent timers should not have their -+ * start/stop methods called directly, as the children will call it for you. -+ *

-+ * Parent Timers are used to group multiple subsections togethers and get a summary of them combined ++ *

Returns a handler that has a groupHandler timer handler. Parent timers should not have their ++ * start/stop methods called directly, as the children will call it for you.

++ * ++ * Parent Timers are used to group multiple subsections together and get a summary of them combined + * Parent Handler can not be changed after first call + * + * @param plugin Plugin to own the Timing @@ -1231,8 +1231,8 @@ index 0000000..e51e232 + } + + /** -+ * Sets whether or not the Spigot Timings system should be enabled -+ *

++ *

Sets whether or not the Spigot Timings system should be enabled

++ * + * Calling this will reset timing data. + * + * @param enabled Should timings be reported @@ -1243,9 +1243,9 @@ index 0000000..e51e232 + } + + /** -+ * Gets whether or not the Verbose level of timings is enabled. -+ *

-+ * When Verbose is disabled, high-frequency timings will not be available ++ *

Sets whether or not the Timings should monitor at Verbose level.

++ * ++ *

When Verbose is disabled, high-frequency timings will not be available.

+ * + * @return Enabled or not + */ @@ -1267,8 +1267,8 @@ index 0000000..e51e232 + } + + /** -+ * Gets the interval between Timing History report generation. -+ *

++ *

Gets the interval between Timing History report generation.

++ * + * Defaults to 5 minutes (6000 ticks) + * + * @return Interval in ticks @@ -1278,9 +1278,9 @@ index 0000000..e51e232 + } + + /** -+ * Sets the interval between Timing History report generations. -+ *

-+ * Defaults to 5 minutes (6000 ticks) ++ *

Sets the interval between Timing History report generations.

++ * ++ *

Defaults to 5 minutes (6000 ticks)

+ * + * This will recheck your history length, so lowering this value will lower your + * history length if you need more than 60 history windows. @@ -1347,7 +1347,7 @@ index 0000000..e51e232 + * Generates a report and sends it to the specified command sender. + * + * If sender is null, ConsoleCommandSender will be used. -+ * @param sender ++ * @param sender The sender to send to, or null to use the ConsoleCommandSender + */ + public static void generateReport(CommandSender sender) { + if (sender == null) { @@ -1880,7 +1880,7 @@ index 0000000..dd78647 +} 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 0000000..d27aa9b +index 0000000..67c39df --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsManager.java @@ -0,0 +1,194 @@ @@ -2033,8 +2033,8 @@ index 0000000..d27aa9b + + + /** -+ * Due to access restrictions, we need a helper method to get a Command TimingHandler with String group -+ *

++ *

Due to access restrictions, we need a helper method to get a Command TimingHandler with String group

++ * + * Plugins should never call this + * + * @param pluginName Plugin this command is associated with @@ -2266,10 +2266,10 @@ index 0000000..5fdf7c4 +} diff --git a/src/main/java/co/aikar/util/LoadingIntMap.java b/src/main/java/co/aikar/util/LoadingIntMap.java new file mode 100644 -index 0000000..7de04fb +index 0000000..8d0f269 --- /dev/null +++ b/src/main/java/co/aikar/util/LoadingIntMap.java -@@ -0,0 +1,68 @@ +@@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015. Starlis LLC / dba Empire Minecraft + * @@ -2282,11 +2282,8 @@ index 0000000..7de04fb +import com.google.common.base.Function; +import gnu.trove.map.hash.TIntObjectHashMap; + -+import java.lang.reflect.Constructor; -+import java.util.*; -+ +/** -+ * Allows you to pass a Loader function that when a key is accessed that doesn't exists, ++ * Allows you to pass a Loader function that when a key is accessed that doesn't exist, + * automatically loads the entry into the map by calling the loader Function. + * + * .get() Will only return null if the Loader can return null. @@ -2297,7 +2294,6 @@ index 0000000..7de04fb + * + * Do not wrap the backing map with Collections.synchronizedMap. + * -+ * @param Key + * @param Value + */ +public class LoadingIntMap extends TIntObjectHashMap { @@ -2305,8 +2301,7 @@ index 0000000..7de04fb + + /** + * Initializes an auto loading map using specified loader and backing map -+ * @param backingMap -+ * @param loader ++ * @param loader The loader + */ + public LoadingIntMap(Function loader) { + this.loader = loader;