Class SystemdProperties.FileDescriptors

java.lang.Object
com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.Toggle
com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.FileDescriptors
Enclosing class:
SystemdProperties

public static class SystemdProperties.FileDescriptors extends SystemdProperties.Toggle
The FileDescriptorStatusProvider, which provides information regarding the open file descriptors.

The FileDescriptorStatusProvider is always a health provider of the watchdog, while enabled, and these properties control its health: it is opted into, as it lets systemd restart the application, so the application is always healthy unless enabled.

  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Check the share of the limit of file descriptors from which the application is unhealthy.
    @Nullable Duration
    Check the delay before suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.
    boolean
    Check if the watchdog heartbeat is suppressed while the open file descriptors are at or above the threshold.
    void
    setHealth(boolean health)
    Enable or disable suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.
    void
    setThreshold(double threshold)
    Set the share of the limit of file descriptors from which the application is unhealthy.
    void
    setUnhealthyDelay(@Nullable Duration unhealthyDelay)
    Set the delay before suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.

    Methods inherited from class com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.Toggle

    isEnabled, setEnabled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isHealth

      public boolean isHealth()
      Check if the watchdog heartbeat is suppressed while the open file descriptors are at or above the threshold.
      Returns:
      true if the file descriptors about to run out make the application unhealthy
    • setHealth

      public void setHealth(boolean health)
      Enable or disable suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.
      Parameters:
      health - true to make the application unhealthy when the file descriptors are about to run out
    • getThreshold

      public double getThreshold()
      Check the share of the limit of file descriptors from which the application is unhealthy.
      Returns:
      the share of the limit, greater than 0 and at most 1
    • setThreshold

      public void setThreshold(double threshold)
      Set the share of the limit of file descriptors from which the application is unhealthy.
      Parameters:
      threshold - the share of the limit, greater than 0 and at most 1
    • getUnhealthyDelay

      public @Nullable Duration getUnhealthyDelay()
      Check the delay before suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.
      Returns:
      the delay, or null if there is no delay
    • setUnhealthyDelay

      public void setUnhealthyDelay(@Nullable Duration unhealthyDelay)
      Set the delay before suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.
      Parameters:
      unhealthyDelay - the delay, or null to disable the delay