Package co.aikar.timings
Class Timings
java.lang.Object
co.aikar.timings.Timings
Deprecated, for removal: This API element is subject to removal in a future version.
Timings will likely be replaced with Spark in the future
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Timing
Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic Component
Deprecated, for removal: This API element is subject to removal in a future version.static void
Deprecated, for removal: This API element is subject to removal in a future version.Generates a report and sends it to the specified listener.static void
generateReport
(@Nullable CommandSender sender) Deprecated, for removal: This API element is subject to removal in a future version.Generates a report and sends it to the specified command sender.static int
Deprecated, for removal: This API element is subject to removal in a future version.Gets the interval between Timing History report generation.static int
Deprecated, for removal: This API element is subject to removal in a future version.Gets how long in ticks Timings history is kept for the server.static boolean
Deprecated, for removal: This API element is subject to removal in a future version.Gets whether or not the Spigot Timings system is enabledstatic boolean
Deprecated, for removal: This API element is subject to removal in a future version.Sets whether or not the Timings should monitor at Verbose level.Deprecated, for removal: This API element is subject to removal in a future version.Returns a Timing for a plugin corresponding to a name.Deprecated, for removal: This API element is subject to removal in a future version.Returns a handler that has a groupHandler timer handler.Deprecated, for removal: This API element is subject to removal in a future version.Returns a Timing object after starting it, useful for Java7 try-with-resources.Deprecated, for removal: This API element is subject to removal in a future version.Returns a Timing object after starting it, useful for Java7 try-with-resources.static void
reset()
Deprecated, for removal: This API element is subject to removal in a future version.Resets all Timing Datastatic void
setHistoryInterval
(int interval) Deprecated, for removal: This API element is subject to removal in a future version.Sets the interval between Timing History report generations.static void
setHistoryLength
(int length) Deprecated, for removal: This API element is subject to removal in a future version.Sets how long Timing History reports are kept for the server.static void
setTimingsEnabled
(boolean enabled) Deprecated, for removal: This API element is subject to removal in a future version.Sets whether or not the Spigot Timings system should be enabledstatic void
setVerboseTimingsEnabled
(boolean enabled) Deprecated, for removal: This API element is subject to removal in a future version.Sets whether or not the Timings should monitor at Verbose level.
-
Field Details
-
NULL_HANDLER
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
of
@NotNull public static @NotNull Timing of(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String name) Deprecated, for removal: This API element is subject to removal in a future version.Returns a Timing for a plugin corresponding to a name.- Parameters:
plugin
- Plugin to own the Timingname
- Name of Timing- Returns:
- Handler
-
of
@NotNull public static @NotNull Timing of(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String name, @Nullable @Nullable Timing groupHandler) Deprecated, for removal: This API element is subject to removal in a future version.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- Parameters:
plugin
- Plugin to own the Timingname
- Name of TiminggroupHandler
- Parent handler to mirror .start/stop calls to- Returns:
- Timing Handler
-
ofStart
@NotNull public static @NotNull Timing ofStart(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String name) Deprecated, for removal: This API element is subject to removal in a future version.Returns a Timing object after starting it, useful for Java7 try-with-resources. try (Timing ignored = Timings.ofStart(plugin, someName)) { // timed section }- Parameters:
plugin
- Plugin to own the Timingname
- Name of Timing- Returns:
- Timing Handler
-
ofStart
@NotNull public static @NotNull Timing ofStart(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String name, @Nullable @Nullable Timing groupHandler) Deprecated, for removal: This API element is subject to removal in a future version.Returns a Timing object after starting it, useful for Java7 try-with-resources. try (Timing ignored = Timings.ofStart(plugin, someName, groupHandler)) { // timed section }- Parameters:
plugin
- Plugin to own the Timingname
- Name of TiminggroupHandler
- Parent handler to mirror .start/stop calls to- Returns:
- Timing Handler
-
isTimingsEnabled
public static boolean isTimingsEnabled()Deprecated, for removal: This API element is subject to removal in a future version.Gets whether or not the Spigot Timings system is enabled- Returns:
- Enabled or not
-
setTimingsEnabled
public static void setTimingsEnabled(boolean enabled) Deprecated, for removal: This API element is subject to removal in a future version.Sets whether or not the Spigot Timings system should be enabled
Calling this will reset timing data.- Parameters:
enabled
- Should timings be reported
-
deprecationMessage
Deprecated, for removal: This API element is subject to removal in a future version. -
isVerboseTimingsEnabled
public static boolean isVerboseTimingsEnabled()Deprecated, for removal: This API element is subject to removal in a future version.Sets whether or not the Timings should monitor at Verbose level.
When Verbose is disabled, high-frequency timings will not be available.
- Returns:
- Enabled or not
-
setVerboseTimingsEnabled
public static void setVerboseTimingsEnabled(boolean enabled) Deprecated, for removal: This API element is subject to removal in a future version.Sets whether or not the Timings should monitor at Verbose level.
When Verbose is disabled, high-frequency timings will not be available. Calling this will reset timing data.- Parameters:
enabled
- Should high-frequency timings be reported
-
getHistoryInterval
public static int getHistoryInterval()Deprecated, for removal: This API element is subject to removal in a future version.Gets the interval between Timing History report generation.
Defaults to 5 minutes (6000 ticks)- Returns:
- Interval in ticks
-
setHistoryInterval
public static void setHistoryInterval(int interval) Deprecated, for removal: This API element is subject to removal in a future version.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.- Parameters:
interval
- Interval in ticks
-
getHistoryLength
public static int getHistoryLength()Deprecated, for removal: This API element is subject to removal in a future version.Gets how long in ticks Timings history is kept for the server. Defaults to 1 hour (72000 ticks)- Returns:
- Duration in Ticks
-
setHistoryLength
public static void setHistoryLength(int length) Deprecated, for removal: This API element is subject to removal in a future version.Sets how long Timing History reports are kept for the server. Defaults to 1 hours(72000 ticks) This value is capped at a maximum of getHistoryInterval() * MAX_HISTORY_FRAMES (12) Will not reset Timing Data but may truncate old history if the new length is less than old length.- Parameters:
length
- Duration in ticks
-
reset
public static void reset()Deprecated, for removal: This API element is subject to removal in a future version.Resets all Timing Data -
generateReport
Deprecated, for removal: This API element is subject to removal in a future version.Generates a report and sends it to the specified command sender. If sender is null, ConsoleCommandSender will be used.- Parameters:
sender
- The sender to send to, or null to use the ConsoleCommandSender
-
generateReport
Deprecated, for removal: This API element is subject to removal in a future version.Generates a report and sends it to the specified listener. Use withBufferedCommandSender
to get full response when done!- Parameters:
sender
- The listener to send responses too.
-