-
Notifications
You must be signed in to change notification settings - Fork 967
Open
Labels
Description
If a client handles many requests, using multiple event loops instead of one allows better CPU utilization and faster request processing. To decide the number of event loops allocated to an endpoint, the client's current traffic information must be considered.
For that, I propose to expose ClientMetrics for use in selecting the number of event loops.
public class ClientMetrics {
/**
* Returns the number of all pending requests.
*/
public long pendingRequests() {
return pendingHttp1Requests() + pendingHttp2Requests();
}
/**
* Returns the number of pending http1 requests.
*/
public long pendingHttp1Requests() {
return ...;
}
/**
* Returns the number of pending http2 requests.
*/
public long pendingHttp2Requests() {
return ...;
}
/**
* Returns the number of all active requests.
*/
public Map<Endpoint, Integer> activeRequestsPerEndpoint() {
return ...;
}
...
}