Skip to content

Conversation

@chickenchickenlove
Copy link
Contributor

Motivation:

Because of #6372 .

Modifications:

  • Add new class ClientMetrics.
  • HttpClientFactory has ClientMetrics as its field.
  • HttpChannelPool has ClientMetrics as its field.
  • HttpChannelPool calls ClientMetrics whenever calling setPendingAcquisition(...) and removePendingAcquisition(...).
  • HttpSessionHandler calls ClientMetrics to increment count for active request and reserve to decrement count of active request.

Result:

/**
* Collects simple client-side metrics such as:
* <ul>
* <li>The number of pending requests per {@link SessionProtocol}</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question) If the objective is to determine the optimal number of event loops depending on pending requests for each endpoint group/protocol, would it be enough to check the duration instead?

final EndpointGroup endpointGroup = ctx.endpointGroup();
ctx.log().whenComplete().thenAccept(log -> {
    final long pendingDuration = log.connectionTimings().pendingAcquisitionDurationNanos();
    final SessionProtocol sessionProtocol = log.sessionProtocol();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose client request metrics

2 participants