dotCMS / dotCMS/core

[TASK] Implement cache region list and statistics endpoints

Open
#35,196 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale Team : Modernization
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

Implement two endpoints in CacheResource.java for the Maintenance portlet Cache tab: one to list cache region names (for the flush dropdown) and one to return cache statistics (JVM memory + per-provider per-region hit/miss/size data).

Acceptance Criteria

GET /v1/caches

  • API caller must receive an alphabetically sorted list of all cache region names
  • Response must use standard ResponseEntityView wrapper
  • Must require backend user with Maintenance portlet access

GET /v1/caches/stats

  • API caller must receive JVM memory information: maxMemory, allocatedMemory, usedMemory, freeMemory (as raw long values in bytes)
  • API caller must receive a list of cache providers, each containing: providerName, column names, and per-region statistics
  • Per-region statistics must include all columns from CacheProviderStats.getStatColumns() with values from CacheStats.getStatValue(col)
  • Must require backend user with Maintenance portlet access
Priority

None

Additional Context
  • Region names come from CacheLocator.getCacheIndexes() — returns Object[], cast each to String and sort
  • Cache stats come from CacheLocator.getCacheAdministrator().getCacheStatsList() — returns List<CacheProviderStats>
  • Each CacheProviderStats has getProviderName(), getStatColumns() (LinkedHashSet), and getStats() (List of CacheStats)
  • JVM memory: Runtime.getRuntime().maxMemory(), .totalMemory(), .freeMemory()

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in CacheResource.java and trace CacheLocator.getCacheIndexes() for region names and CacheLocator.getCacheAdministrator().getCacheStatsList() for provider statistics. Implement the two GET endpoints with the ResponseEntityView wrapper and Maintenance portlet access, then verify the sorted regions, JVM memory values, provider columns, and per-region statistics match the acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.