Package com.comphenix.protocol.timing
Class TimedListenerManager
java.lang.Object
com.comphenix.protocol.timing.TimedListenerManager
Represents a system for recording the time spent by each packet listener.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Reset all packet gathering data.static TimedListenerManagerRetrieve the shared listener manager.Retrieve the time the listener was started.Retrieve the time the time listeners was stopped.Retrieve every tracked plugin.getTracker(PacketListener listener, TimedListenerManager.ListenerType type) Retrieve the timed tracker associated with the given listener and listener type.getTracker(String pluginName, TimedListenerManager.ListenerType type) Retrieve the timed tracker associated with the given plugin and listener type.getTracker(org.bukkit.plugin.Plugin plugin, TimedListenerManager.ListenerType type) Retrieve the timed tracker associated with the given plugin and listener type.booleanisTiming()Determine if we are currently timing listeners.booleanStart timing listeners.booleans Stop timing listeners.
-
Constructor Details
-
TimedListenerManager
public TimedListenerManager()
-
-
Method Details
-
getInstance
Retrieve the shared listener manager.This should never change.
- Returns:
- The shared listener manager.
-
startTiming
public boolean startTiming()Start timing listeners.- Returns:
- TRUE if we started timing, FALSE if we are already timing listeners.
-
stopTiming
public boolean stopTiming()s Stop timing listeners.- Returns:
- TRUE if we stopped timing, FALSE otherwise.
-
getStarted
Retrieve the time the listener was started.- Returns:
- The time it was started, or NULL if they have never been started.
-
getStopped
Retrieve the time the time listeners was stopped.- Returns:
- The time they were stopped, or NULL if not found.
-
isTiming
public boolean isTiming()Determine if we are currently timing listeners.- Returns:
- TRUE if we are, FALSE otherwise.
-
clear
public void clear()Reset all packet gathering data. -
getTrackedPlugins
Retrieve every tracked plugin.- Returns:
- Every tracked plugin.
-
getTracker
public TimedTracker getTracker(org.bukkit.plugin.Plugin plugin, TimedListenerManager.ListenerType type) Retrieve the timed tracker associated with the given plugin and listener type.- Parameters:
plugin- - the plugin.type- - the listener type.- Returns:
- The timed tracker.
-
getTracker
Retrieve the timed tracker associated with the given listener and listener type.- Parameters:
listener- - the listener.type- - the listener type.- Returns:
- The timed tracker.
-
getTracker
Retrieve the timed tracker associated with the given plugin and listener type.- Parameters:
pluginName- - the plugin name.type- - the listener type.- Returns:
- The timed tracker.
-