Skip to content

Expose client request metrics #6372

@ikhoon

Description

@ikhoon

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 ...;
    }
    
    ...
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions