Package org.eclipse.jetty.server
Class LowResourceMonitor
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.LowResourceMonitor
- All Implemented Interfaces:
Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle
@ManagedObject("Monitor for low resource conditions and activate a low resource mode if detected")
@Deprecated(since="2021-05-27")
public class LowResourceMonitor
extends ContainerLifeCycle
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
A monitor for low resources, low resources can be detected by:
ThreadPool.isLowOnThreads()ifConnector.getExecutor()is an instance ofThreadPoolandsetMonitorThreads(boolean)is true.- If
setMaxMemory(long)is non zero then low resources is detected if the JVMsRuntimeinstance hasRuntime.totalMemory()minusRuntime.freeMemory()greater thangetMaxMemory() - If
setMaxConnections(int)is non zero then low resources is detected if the total number of connections exceedsgetMaxConnections(). This feature is deprecated and replaced byConnectionLimit
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassDeprecated.static interfaceDeprecated.classDeprecated.classDeprecated.classDeprecated.Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLowResourceCheck(LowResourceMonitor.LowResourceCheck lowResourceCheck) Deprecated.Deprecated.intDeprecated.Deprecated.longDeprecated.intDeprecated.Replaced by ConnectionLimitintDeprecated.longDeprecated.Deprecated.booleanDeprecated.intDeprecated.Deprecated.booleanDeprecated.booleanDeprecated.voidsetAcceptingInLowResources(boolean acceptingInLowResources) Deprecated.voidsetLowResourceChecks(Set<LowResourceMonitor.LowResourceCheck> lowResourceChecks) Deprecated.voidsetLowResourcesIdleTimeout(int lowResourcesIdleTimeoutMS) Deprecated.voidsetLowResourcesStarted(long lowStarted) Deprecated.voidsetMaxConnections(int maxConnections) Deprecated.Replaced byConnectionLimitvoidsetMaxLowResourcesTime(int maxLowResourcesTimeMS) Deprecated.voidsetMaxMemory(long maxMemoryBytes) Deprecated.voidsetMonitoredConnectors(Collection<Connector> monitoredConnectors) Deprecated.voidsetMonitorThreads(boolean monitorThreads) Deprecated.voidsetPeriod(int periodMS) Deprecated.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
LowResourceMonitor
Deprecated.
-
-
Method Details
-
getMonitorThreads
@ManagedAttribute("True if low available threads status is monitored") public boolean getMonitorThreads()Deprecated. -
setMonitorThreads
public void setMonitorThreads(boolean monitorThreads) Deprecated.- Parameters:
monitorThreads- If true, check connectors executors to see if they areThreadPoolinstances that are low on threads.
-
getMaxConnections
@ManagedAttribute("The maximum connections allowed for the monitored connectors before low resource handling is activated") @Deprecated public int getMaxConnections()Deprecated.Replaced by ConnectionLimit- Returns:
- The maximum connections allowed for the monitored connectors before low resource handling is activated
-
setMaxConnections
Deprecated.Replaced byConnectionLimit- Parameters:
maxConnections- The maximum connections before low resources state is triggered
-
getReasons
@ManagedAttribute("The reasons the monitored connectors are low on resources") public String getReasons()Deprecated. -
isLowOnResources
@ManagedAttribute("Are the monitored connectors low on resources?") public boolean isLowOnResources()Deprecated. -
getLowResourcesReasons
@ManagedAttribute("The reason(s) the monitored connectors are low on resources") public String getLowResourcesReasons()Deprecated. -
getLowResourcesStarted
@ManagedAttribute("Get the timestamp in ms since epoch that low resources state started") public long getLowResourcesStarted()Deprecated. -
setLowResourcesStarted
public void setLowResourcesStarted(long lowStarted) Deprecated. -
getMonitoredConnectors
@ManagedAttribute("The monitored connectors. If null then all server connectors are monitored") public Collection<Connector> getMonitoredConnectors()Deprecated. -
setMonitoredConnectors
Deprecated.- Parameters:
monitoredConnectors- The collections of Connectors that should be monitored for low resources.
-
isAcceptingInLowResources
@ManagedAttribute("If false, new connections are not accepted while in low resources") public boolean isAcceptingInLowResources()Deprecated. -
setAcceptingInLowResources
public void setAcceptingInLowResources(boolean acceptingInLowResources) Deprecated. -
getPeriod
Deprecated. -
setPeriod
public void setPeriod(int periodMS) Deprecated.- Parameters:
periodMS- The period in ms to monitor for low resources
-
getLowResourcesIdleTimeout
@ManagedAttribute("The idletimeout in ms to apply to all existing connections when low resources is detected") public int getLowResourcesIdleTimeout()Deprecated. -
setLowResourcesIdleTimeout
public void setLowResourcesIdleTimeout(int lowResourcesIdleTimeoutMS) Deprecated.- Parameters:
lowResourcesIdleTimeoutMS- The timeout in ms to apply to EndPoints when in the low resources state.
-
getMaxLowResourcesTime
@ManagedAttribute("The maximum time in ms that low resources condition can persist before lowResourcesIdleTimeout is applied to new connections as well as existing connections") public int getMaxLowResourcesTime()Deprecated. -
setMaxLowResourcesTime
public void setMaxLowResourcesTime(int maxLowResourcesTimeMS) Deprecated.- Parameters:
maxLowResourcesTimeMS- The time in milliseconds that a low resource state can persist before the low resource idle timeout is reapplied to all connections
-
getMaxMemory
@ManagedAttribute("The maximum memory (in bytes) that can be used before low resources is triggered. Memory used is calculated as (totalMemory-freeMemory).") public long getMaxMemory()Deprecated. -
setMaxMemory
public void setMaxMemory(long maxMemoryBytes) Deprecated.- Parameters:
maxMemoryBytes- The maximum memory in bytes in use before low resources is triggered.
-
getLowResourceChecks
Deprecated. -
setLowResourceChecks
Deprecated. -
addLowResourceCheck
Deprecated.
-