Class Watchdog
java.lang.Object
ua.mcchickenstudio.opencreative.managers.stability.Watchdog
- All Implemented Interfaces:
Manager,ShutDownable,StabilityManager,Startable,Toggleable
Watchdog
This class represents a stability manager, called Watchdog, that logs about TPS stability and memory usage.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull StabilityStateReturns stability state of database connection.@NotNull StabilityStateReturns stability state of memory.@NotNull StringgetName()Returns name of manager, that will be displayed by request in the logs.@NotNull StabilityStategetState()Returns stability state of all systems.@NotNull StabilityStateReturns stability state of storage.@NotNull StabilityStateReturns stability state of ticks.doublegetTPS()Returns average TPS value in the latest 5 seconds.booleanChecks whether manager was started successfully and it currently works.voidshutdown()Does tasks on shutdown.voidstart()Does tasks on start.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ua.mcchickenstudio.opencreative.managers.stability.StabilityManager
isFine, isVeryBad
-
Constructor Details
-
Watchdog
public Watchdog()
-
-
Method Details
-
start
public void start()Description copied from interface:StartableDoes tasks on start. -
isWorking
public boolean isWorking()Description copied from interface:ToggleableChecks whether manager was started successfully and it currently works.- Specified by:
isWorkingin interfaceToggleable- Returns:
- true - started up, false - shut downed.
-
shutdown
public void shutdown()Description copied from interface:ShutDownableDoes tasks on shutdown.- Specified by:
shutdownin interfaceShutDownable
-
getDatabaseState
Description copied from interface:StabilityManagerReturns stability state of database connection.- Specified by:
getDatabaseStatein interfaceStabilityManager- Returns:
- state of database.
-
getMemoryState
Description copied from interface:StabilityManagerReturns stability state of memory.- Specified by:
getMemoryStatein interfaceStabilityManager- Returns:
- state of RAM.
-
getStorageState
Description copied from interface:StabilityManagerReturns stability state of storage.- Specified by:
getStorageStatein interfaceStabilityManager- Returns:
- state of storage.
-
getTicksState
Description copied from interface:StabilityManagerReturns stability state of ticks.- Specified by:
getTicksStatein interfaceStabilityManager- Returns:
- state of TPS.
-
getName
Description copied from interface:ManagerReturns name of manager, that will be displayed by request in the logs. -
getTPS
public double getTPS()Returns average TPS value in the latest 5 seconds.- Returns:
- average TPS.
-
getState
Description copied from interface:StabilityManagerReturns stability state of all systems.- Specified by:
getStatein interfaceStabilityManager- Returns:
- state of plugin
-