Commit 5fb7416
refactor(collection): migrate metrics from /admin/mbeans to /admin/metrics API
Replace the deprecated /admin/mbeans endpoint with the Solr Metrics API
(/admin/metrics) for cache and handler statistics. The Metrics API is
node-level, so fetchMetrics now searches for the matching core registry
by prefix. Cache metrics remain nested NamedList objects while handler
metrics use flat dotted keys (e.g. QUERY./select.requests), requiring
separate extraction logic.
Key changes:
- fetchMetrics uses /admin/metrics with group=core and prefix filtering
- Handler extraction refactored to read flat keys via extractFlatHandlerInfo
- Core registry matching uses trailing dot to prevent false prefix matches
- Remove unused AVG_TIME_PER_REQUEST_FIELD and AVG_REQUESTS_PER_SECOND_FIELD
- Add integration tests for cache and handler metrics against real Solr
- Remove dead test helper createCompleteMockCacheData
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>1 parent aaa1089 commit 5fb7416
3 files changed
Lines changed: 326 additions & 375 deletions
File tree
- src
- main/java/org/apache/solr/mcp/server/collection
- test/java/org/apache/solr/mcp/server/collection
0 commit comments