Class StuckThreadDetectionFeature
java.lang.Object
io.helidon.webserver.StuckThreadDetectionFeature
- All Implemented Interfaces:
RuntimeType.Api<StuckThreadDetectionConfig>, Weighted, NamedService, ServerFeature, Comparable<Weighted>
public final class StuckThreadDetectionFeature
extends Object
implements Weighted, ServerFeature, RuntimeType.Api<StuckThreadDetectionConfig>
Reports HTTP request threads that have been executing for longer than a configured threshold.
Detection covers ordinary HTTP routing and handler processing. It does not include post-routing transport cleanup, idle HTTP/1 connections, connections handed to an upgraded protocol, HTTP/2 connection readers, or HTTP/2 subprotocol processing such as gRPC streams. A long-running request is not necessarily stuck, so this feature reports diagnostics but never interrupts a request thread.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ServerFeature
ServerFeature.RoutingBuilders, ServerFeature.ServerFeatureContext, ServerFeature.SocketBuildersModifier and TypeInterfaceDescriptionstatic interfaceAccess to builders of various routing types.static interfaceA wrapping object to access various configurable elements of server forServerFeature.static interfaceA wrapping object to access listener related builders. -
Field Summary
Fields inherited from interface Weighted
DEFAULT_WEIGHTModifier and TypeFieldDescriptionstatic final doubleDefault weight for any weighted component (whether it implements this interface or usesWeightannotation). -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a fluent configuration builder.static StuckThreadDetectionFeaturecreate()Create a stuck thread detection feature with default configuration.static StuckThreadDetectionFeatureCreate a stuck thread detection feature from configuration.static StuckThreadDetectionFeaturecreate(StuckThreadDetectionConfig config) Create a stuck thread detection feature from its configuration prototype.static StuckThreadDetectionFeaturecreate(Consumer<StuckThreadDetectionConfig.Builder> builderConsumer) Create a stuck thread detection feature, customizing its configuration.name()Name of this implementation, as provided inConfiguredProvider.create(Config, String).The prototype as it was received when creating this runtime object instance.voidsetup(ServerFeature.ServerFeatureContext featureContext) Set up a server feature.type()Type of this implementation, to distinguish instances of same type, with differentNamedService.name().doubleweight()Weight of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation).
-
Method Details
-
create
Create a stuck thread detection feature with default configuration.- Returns:
- a new feature
-
create
Create a stuck thread detection feature from configuration.- Parameters:
config- configuration- Returns:
- a new feature
-
create
Create a stuck thread detection feature from its configuration prototype.- Parameters:
config- configuration prototype- Returns:
- a new feature
-
create
public static StuckThreadDetectionFeature create(Consumer<StuckThreadDetectionConfig.Builder> builderConsumer) Create a stuck thread detection feature, customizing its configuration.- Parameters:
builderConsumer- consumer of the configuration builder- Returns:
- a new feature
-
builder
Create a fluent configuration builder.- Returns:
- a new builder
-
setup
Description copied from interface:ServerFeatureSet up a server feature. Server features can modify server configuration, right before the server is created. To access listener configuration, or routing, a list of all listeners is provided.- Specified by:
setupin interfaceServerFeature- Parameters:
featureContext- to access builders of webserver, listeners, and routing
-
name
Description copied from interface:NamedServiceName of this implementation, as provided inConfiguredProvider.create(Config, String).- Specified by:
namein interfaceNamedService- Returns:
- name of this service
-
type
Description copied from interface:NamedServiceType of this implementation, to distinguish instances of same type, with differentNamedService.name(). Use for exampleConfiguredProvider.configKey()to define the type.- Specified by:
typein interfaceNamedService- Returns:
- type of this service
-
weight
public double weight()Description copied from interface:WeightedWeight of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation). If not dynamic, you can use theWeightannotation rather than implementing this interface as long as it is supported by the library using thisWeighted. -
prototype
Description copied from interface:RuntimeType.ApiThe prototype as it was received when creating this runtime object instance.- Specified by:
prototypein interfaceRuntimeType.Api<StuckThreadDetectionConfig>- Returns:
- prototype object used to create this instance
-