Package org.eclipse.jetty.util
Class ProcessorUtils
java.lang.Object
org.eclipse.jetty.util.ProcessorUtils
ProcessorUtils provides access to runtime info about processors, that may be overridden by system properties or environment variables.
This can be useful in virtualized environments where the runtime may miss report the available resources.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Returns the number of available processors, from System Property "JETTY_AVAILABLE_PROCESSORS", or if not set then from environment variable "JETTY_AVAILABLE_PROCESSORS" or if not set then fromRuntime.availableProcessors()
.static void
setAvailableProcessors
(int processors)
-
Field Details
-
AVAILABLE_PROCESSORS
- See Also:
-
-
Constructor Details
-
ProcessorUtils
public ProcessorUtils()
-
-
Method Details
-
availableProcessors
public static int availableProcessors()Returns the number of available processors, from System Property "JETTY_AVAILABLE_PROCESSORS", or if not set then from environment variable "JETTY_AVAILABLE_PROCESSORS" or if not set then fromRuntime.availableProcessors()
.- Returns:
- the number of processors
-
setAvailableProcessors
public static void setAvailableProcessors(int processors)
-