Skip to content

Conversation

@Oscarcheng0312
Copy link
Contributor

@Oscarcheng0312 Oscarcheng0312 commented Oct 13, 2025


Ⅰ. 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.

This PR does not include any private protocol / networking code (Netty / gRPC).
Transport (Netty / gRPC / REST) will be integrated in a follow-up PR to keep layering clean.


Ⅱ. 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

  • All new Java files include ASF headers.
  • No Netty / gRPC classes are included in this PR; those will live in a separate PR.
  • The design keeps providers → collector → monitor → cache → enhancer independent from transport for easy pluggability.
  • Package structure may be further refined after backend transport abstraction (e.g., gRPC integration) is finalized.

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