Skip to content

Optimize client stats collection#2270

Open
pavel-ptashyts wants to merge 1 commit into
AsyncHttpClient:mainfrom
maygemdev:perf/client-stats-single-pass
Open

Optimize client stats collection#2270
pavel-ptashyts wants to merge 1 commit into
AsyncHttpClient:mainfrom
maygemdev:perf/client-stats-single-pass

Conversation

@pavel-ptashyts

@pavel-ptashyts pavel-ptashyts commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace stream collectors in ChannelManager.getClientStats() with explicit per-host counters.
  • Count idle pooled channels through direct partition iteration while preserving host filtering and tombstone-skipping behavior.
  • Add coverage for per-host idle counts so claimed channels are not reported as leasable.

Validation

  • ./mvnw -pl client -Dtest=DefaultChannelPoolTest,ClientStatsTest test
  • ./mvnw -pl client -DskipTests -Dgpg.skip=true verify
  • git diff --check

Attribution

Codex on behalf of Pavel Ptashyts

Replace stream grouping in client stats snapshots with explicit
per-host counters to avoid redundant collector passes when metrics are
scraped frequently. Count idle pooled channels with direct partition
iteration while preserving existing host filtering and tombstone
skipping behavior.

Add coverage for idle per-host counts so claimed channels are not
reported as leasable.

Codex on behalf of Pavel Ptashyts

Co-Authored-By: Codex <codex@openai.com>
@pavel-ptashyts
pavel-ptashyts force-pushed the perf/client-stats-single-pass branch from 3bae6af to 50dbb79 Compare July 20, 2026 08:50
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.

1 participant