Skip to content

Merge dev: accurate connection tracking + pool config (#114, #115, #119)#121

Open
cbaugus wants to merge 5 commits intomainfrom
dev
Open

Merge dev: accurate connection tracking + pool config (#114, #115, #119)#121
cbaugus wants to merge 5 commits intomainfrom
dev

Conversation

@cbaugus
Copy link
Copy Markdown
Owner

@cbaugus cbaugus commented Apr 14, 2026

Summary

Merges all connection pool improvements from dev into main for release:

Breaking Metric Changes

Removed Replacement
connection_pool_likely_new_total connection_pool_new_total
connection_pool_likely_reused_total connection_pool_reused_total

connection_pool_reuse_rate_percent is kept but now uses accurate port-based tracking.

Removed YAML field: metricsReuseThresholdMs (no longer needed).

How It Works

Each HTTP response's local SocketAddr is extracted from hyper's HttpInfo. A new local port = new TCP connection. Same port = reused from pool. Deterministic and accurate at any RPS.

Test plan

  • CI passes on dev (lint, clippy, tests)
  • Dev Docker build tested against live target
  • Verified connection_pool_new_total and connection_pool_reused_total report accurately
  • Verified pool: { maxIdlePerHost: 0, idleTimeoutSecs: 0 } forces new connections

🤖 Generated with Claude Code

cbaugus and others added 5 commits April 13, 2026 20:08
#119)

Remove the unreliable latency-based heuristic (likely_new/likely_reused)
and replace with deterministic local TCP port tracking.  Each response's
local SocketAddr is extracted from hyper's HttpInfo — a new local port
means a new TCP connection, same port means reused.

Breaking metric changes:
  - Removed: connection_pool_likely_new_total
  - Removed: connection_pool_likely_reused_total
  - Added:   connection_pool_new_total
  - Added:   connection_pool_reused_total
  - connection_pool_reuse_rate_percent now uses accurate tracking
  - Removed: metricsReuseThresholdMs YAML field (no longer needed)

Closes #119

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests now use SocketAddr-based record_request() and the new
ConnectionStats fields (new_connections, reused_connections).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: accurate connection tracking via local port (#119)
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