Skip to content

[TASK] Implement cache region list and statistics endpoints #35196

@hassandotcms

Description

@hassandotcms

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()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions