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
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 TypeMethodDescriptiondoubleCheck the share of the limit of file descriptors from which the application is unhealthy.@Nullable DurationCheck the delay before suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.booleanisHealth()Check if the watchdog heartbeat is suppressed while the open file descriptors are at or above the threshold.voidsetHealth(boolean health) Enable or disable suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.voidsetThreshold(double threshold) Set the share of the limit of file descriptors from which the application is unhealthy.voidsetUnhealthyDelay(@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
-
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:
trueif 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-trueto 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
Check the delay before suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.- Returns:
- the delay, or
nullif there is no delay
-
setUnhealthyDelay
Set the delay before suppressing the watchdog heartbeat while the open file descriptors are at or above the threshold.- Parameters:
unhealthyDelay- the delay, ornullto disable the delay
-