feature(core): add core connection-pool monitoring (implementation, cache) #7693
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
Add the core connection-pool monitoring implementation (transport-agnostic) for CPM backend.
Domain / Model
ConnectionPoolInfo: runtime snapshot DTO for pool metrics.Providers
DruidConnectionPoolMetrics: collect metrics from Druid.HikariConnectionPoolMetrics: collect metrics from HikariCP.Collector
DataSourceConnectionPoolCollector: aggregate metrics from multiple providers.Service
ConnectionPoolMonitor: periodic collection and read APIs.Cache
ConnectionPoolInfoCache: in-memory storage for fast reads.Integration Hook
DataSourceProxyEnhancer: lifecycle hook for automatic registration/unregistration of monitored DataSources.Ⅱ. Does this pull request fix one issue?
No. It introduces the core capability for the connection-pool-monitor backend, independent of transport.
Ⅲ. Why don't you add test cases (unit test/integration test)?
Basic unit tests will be added with the follow-up PR.
Ⅳ. Describe how to verify it
This PR introduces transport-agnostic core logic only. Verification will be provided by
follow-up unit tests that cover providers (Druid / Hikari), the collector, the monitor, and the cache.
Those tests will be sufficient to validate the functionality end-to-end without requiring a running console.
Ⅴ. Special notes for reviews