JCR Statistics icon
Module Id
jcr-stats
Group Id
org.jahia.community
Updated
Requires Jahia
8.2.1.0
Author
Florent BOURASSE
Category
Admin Features
Status
COMMUNITY info

JCR Statistics group_work

JCR Stats helps administrators understand how disk space is distributed throughout the JCR repository. It computes aggregated size and node-count statistics for any JCR subtree, renders an interactive flame graph, displays a hierarchical tree table, lists the largest items, and enables snapshot-based comparison to detect changes over time.

Key Capabilities

 

  • Interactive Flame Graph - Click-to-zoom visualization of space usage by weight (size or node count)
  • Tree Table View - Hierarchical breakdown with size, percentage of total, percentage of parent, and node count
  • Largest Items View - Top-N list of space consumers
  • Snapshot Comparison - Save/load JSON snapshots and diff against a baseline to spot growth anomalies
  • jContent Deep Links - Direct navigation from stats results into the jContent editor
  • Flexible Metrics - Weight by bytes or node count
  • GraphQL & Karaf APIs - Programmatic access to statistics and computation
  • Permission-Based Access - Configurable admin-only access via jcrStatsAdmin permission

Dependencies & Dependants

Dependants
  • NONE

Changelog 2.1.3

A small admin-UI patch release. The JCR Stats admin page now scrolls vertically
when its content is taller than the screen, and the Saved executions history
is shown above the results. Drop-in upgrade from 2.1.2 — no API, permission, or
data changes.

🐛 Fixed

  • The admin page now scrolls when content exceeds the screen. Jahia's admin
    (moonstone) settings frame is a fixed-height region, so a route must provide its
    own scrolling. The JCR Stats page didn't, so once the results, flamegraph and the
    Saved-executions / Exclusions panels stacked taller than the frame, the bottom was
    clipped with no scrollbar. The page now owns a vertical scrollbar, so nothing is
    ever cut off.

🔧 Changed

  • "Saved executions" moved above the results. The saved-run history now appears
    directly under the controls — above the View (flamegraph / tree / largest /
    diff) section — so past runs are the first thing you reach. The panel still
    disappears entirely when there is no history, and the Exclusions panel stays
    below the results.

✅ Quality

  • Backend: 88 Java unit tests. Frontend: Jest suite green, ESLint clean.
  • End-to-end: 33/33 Cypress tests passing (admin UI, API, permissions). The
    flamegraph viewport test was updated to the new layout — it now asserts the
    flamegraph stays full-width with a usable height inside the scrollable container
    (the flamegraph may extend below the fold on a short window, which is expected now
    that the page scrolls).

Upgrade notes

  • Drop-in from 2.1.2 — no migration. Admin route unchanged
    (/jahia/administration/jcrStats), still gated by the jcrStatsAdmin permission.

FAQ

JCR Stats appears in Jahia Administration under Server > System Health > JCR Stats, accessible at the URL /jahia/administration/jcrStatsExecution.

Workflow

  1. Enter a JCR Path (defaults to /sites)
  2. Select "Weight by" - either "Size" (bytes) or "Number of nodes"
  3. Click "Compute" (or press Ctrl+Enter) - starts a background computation
    • A progress indicator appears showing elapsed time and scanned-node count
    • The computation runs on a single server-side background thread
    • Only one computation runs at a time; clicking Compute while one is already running has no effect
  4. When complete - results appear automatically in the Flamegraph view
  5. View Results in Four Tabs:
    • Flamegraph - Interactive, click to zoom in/out; hover for details (mouse-operated; keyboard users should use the Tree table)
    • Tree table - Scrollable, sortable hierarchy showing size, % of total, % of parent, node count (keyboard accessible)
    • Largest items - Top-N nodes by selected metric
    • Comparison - Diff view against a previously saved baseline

Resume-on-Remount: If you navigate away from the JCR Stats page while a computation is running and then return, the progress display resumes from the server's live status (elapsed time and visited count).

UI Controls

Control Purpose
Path input Enter JCR path to analyze (e.g., /sites/digital/)
Weight by dropdown Switch between "Size (bytes)" and "Number of nodes"
Compute button Submit analysis (or Ctrl+Enter)
Flamegraph tab Visualize hierarchy; click a frame to zoom, breadcrumb to zoom out
Tree table tab Browse complete tree with statistics
Largest items tab Sorted list of top-N nodes by metric
Comparison tab Load a baseline snapshot and view differences
Download button (flamegraph tab) Save current snapshot as JSON
Upload button Load a previously saved snapshot
Compare with… button (comparison tab) Load a baseline for diff view

Save & Load Snapshots

 

Use the Download button to save the current tree data as a JSON file (jcr-stats-flamegraph-*.json). Use Upload to load a saved snapshot back into the UI. The comparison view then lets you load a baseline and see side-by-side diffs highlighting growth, shrinkage, and newly added paths.

How To Install

  • In Jahia, go to "Administration --> Server settings --> System components --> Modules"
  • Upload the JAR jcr-stats-X.X.X.jar
  • Check that the module is started

Images

License

MIT License

Copyright (c) 2019 - present Florent BOURASSÉ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.