Expand my Community achievements bar.

SOLVED

How to find Segment store size?

Avatar

Level 2

How to fetch the SEGMENT_REPO_SIZE from JMX console through programmatically.

(JMX console link: http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3DSEGMENT_REPO_SIZE%2Ctype...)

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

 

That's not really specific to AEM, but standard Java code.

 

MBeanServer mbs = java.lang.management.ManagementFactory.getPlatformMBeanServer;

ObjectName name = new ObjectName("org.apache.jackrabbit.oak:Metrics");

Object value = mbs.getAttribute(name,"Count");

System.out.println("Count = " + value.toString());

 

(please don't try to access this value via HTTP ... that's a guarantee to break.)

View solution in original post

4 Replies

Avatar

Employee Advisor

I believe you can just trigger a CURL command, similar to below:

 

curl -u admin:admin http://<host>:<port>/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3DSEGMENT_REPO_SIZE%2Ctype%3DMetrics | grep "Attribute exposed for management" | cut -c 81-90

Avatar

Correct answer by
Employee Advisor

 

That's not really specific to AEM, but standard Java code.

 

MBeanServer mbs = java.lang.management.ManagementFactory.getPlatformMBeanServer;

ObjectName name = new ObjectName("org.apache.jackrabbit.oak:Metrics");

Object value = mbs.getAttribute(name,"Count");

System.out.println("Count = " + value.toString());

 

(please don't try to access this value via HTTP ... that's a guarantee to break.)