Package org.apache.hc.core5.reactor
Interface IOReactorMetricsListener
public interface IOReactorMetricsListener
A listener interface for receiving metrics related to the I/O reactor's
thread pool performance and status.
The implementing class can monitor and act upon important metrics such as active threads, saturation levels, and resource starvation.
- Since:
- 5.4
-
Method Summary
Modifier and TypeMethodDescriptionvoidonQueueWaitTime(long averageWaitTimeMillis) Notifies about the average wait time for connection requests in the queue.voidInvoked when the number of pending connection requests exceeds the maximum allowed connections, indicating possible resource starvation.voidonThreadPoolSaturation(double saturationPercentage) Invoked to report the saturation level of the thread pool as a percentage of the active threads to the maximum allowed connections.voidonThreadPoolStatus(int activeThreads, int pendingConnections) Invoked to report the current status of the thread pool, including active threads and pending connections.
-
Method Details
-
onThreadPoolStatus
void onThreadPoolStatus(int activeThreads, int pendingConnections) Invoked to report the current status of the thread pool, including active threads and pending connections.- Parameters:
activeThreads- The number of active threads handling connections.pendingConnections- The number of pending connection requests in the queue.
-
onThreadPoolSaturation
void onThreadPoolSaturation(double saturationPercentage) Invoked to report the saturation level of the thread pool as a percentage of the active threads to the maximum allowed connections.- Parameters:
saturationPercentage- The percentage indicating thread pool saturation.
-
onResourceStarvationDetected
void onResourceStarvationDetected()Invoked when the number of pending connection requests exceeds the maximum allowed connections, indicating possible resource starvation. -
onQueueWaitTime
void onQueueWaitTime(long averageWaitTimeMillis) Notifies about the average wait time for connection requests in the queue.- Parameters:
averageWaitTimeMillis- average time in milliseconds that connection requests spend in the queue.
-