java.lang.Object
ua.mcchickenstudio.opencreative.managers.stability.Watchdog
All Implemented Interfaces:
Manager, ShutDownable, StabilityManager, Startable, Toggleable

public final class Watchdog extends Object implements StabilityManager, Toggleable

Watchdog

This class represents a stability manager, called Watchdog, that logs about TPS stability and memory usage.
  • Constructor Details

    • Watchdog

      public Watchdog()
  • Method Details

    • start

      public void start()
      Description copied from interface: Startable
      Does tasks on start.
      Specified by:
      start in interface Startable
    • isWorking

      public boolean isWorking()
      Description copied from interface: Toggleable
      Checks whether manager was started successfully and it currently works.
      Specified by:
      isWorking in interface Toggleable
      Returns:
      true - started up, false - shut downed.
    • shutdown

      public void shutdown()
      Description copied from interface: ShutDownable
      Does tasks on shutdown.
      Specified by:
      shutdown in interface ShutDownable
    • getDatabaseState

      @NotNull public @NotNull StabilityState getDatabaseState()
      Description copied from interface: StabilityManager
      Returns stability state of database connection.
      Specified by:
      getDatabaseState in interface StabilityManager
      Returns:
      state of database.
    • getMemoryState

      @NotNull public @NotNull StabilityState getMemoryState()
      Description copied from interface: StabilityManager
      Returns stability state of memory.
      Specified by:
      getMemoryState in interface StabilityManager
      Returns:
      state of RAM.
    • getStorageState

      @NotNull public @NotNull StabilityState getStorageState()
      Description copied from interface: StabilityManager
      Returns stability state of storage.
      Specified by:
      getStorageState in interface StabilityManager
      Returns:
      state of storage.
    • getTicksState

      @NotNull public @NotNull StabilityState getTicksState()
      Description copied from interface: StabilityManager
      Returns stability state of ticks.
      Specified by:
      getTicksState in interface StabilityManager
      Returns:
      state of TPS.
    • getName

      @NotNull public @NotNull String getName()
      Description copied from interface: Manager
      Returns name of manager, that will be displayed by request in the logs.
      Specified by:
      getName in interface Manager
      Returns:
      name of manager.
    • getTPS

      public double getTPS()
      Returns average TPS value in the latest 5 seconds.
      Returns:
      average TPS.
    • getState

      @NotNull public @NotNull StabilityState getState()
      Description copied from interface: StabilityManager
      Returns stability state of all systems.
      Specified by:
      getState in interface StabilityManager
      Returns:
      state of plugin