Hi,

1. Node count from each node type.
> 2. Total node count (from user created node types).
> 3. Total file size (maybe including/excluding version files).
> 4. How many files are stored for a specific extension.
> 5. The smallest file stored (and its size), maybe  for a specific
> extension.
> 6. The largest file stored (and its size) , maybe  for a specific extension
>

it seems using queries is the way to achieve this...



> is it possible to have access to metrics like the ones in
> https://jackrabbit.apache.org/oak/docs/nodestore/document/metrics.html in
> a non osgi environment?
> Should I create a StatisticsProvider and use getCounterStats?
>

After swimming (and sometimes drowning) in code from some Oak classes. I
managed to register some of the MBeans and I could see them in JConsole by
invoking this method

private static void registerBean(String name, Object mBean) {
        try {
            ObjectName objectName = new
ObjectName("com.myApp.test:type=basic,name= " + name);
            MBeanServer server = ManagementFactory.getPlatformMBeanServer();
            server.registerMBean(mBean, objectName);

        } catch (MalformedObjectNameException |
InstanceAlreadyExistsException |
                MBeanRegistrationException | NotCompliantMBeanException e) {
            // handle exceptions
        }
    }

on some Beans. For example:

DocumentNodeStore store = ...;
registerBeanTest(CacheStatsMBean.class.getName() + "_" +
store.getNodeCacheStats().getName(), store.getNodeCacheStats());
registerBeanTest(CacheStatsMBean.class.getName() + "_" +
store.getNodeChildrenCacheStats().getName(),
store.getNodeChildrenCacheStats());
registerBeanTest(DocumentNodeStoreMBean.class.getName(), store.getMBean());

I was also able to see some info from the statistics provider using:

ScheduledExecutorService ex = Executors.newSingleThreadScheduledExecutor();
DefaultStatisticsProvider statsProvider = new DefaultStatisticsProvider(ex);
MongoDocumentStoreMetrics mdsm = new MongoDocumentStoreMetrics(mds,
statsProvider);
mdsm.run();
LOG.info("MongoDB.blobs.size --> " +
statsProvider.getCounterStats("MongoDB.blobs.size",
StatsOptions.DEFAULT).getCount());

Best Regards.

Jorge



El mié., 20 may. 2020 a las 9:48, jorgeeflorez . (<
[email protected]>) escribió:

> Hi,
> is it possible to have access to metrics like the ones in
> https://jackrabbit.apache.org/oak/docs/nodestore/document/metrics.html in
> a non osgi environment?
> Should I create a StatisticsProvider and use getCounterStats?
>
> Jorge
>
> El dom., 17 may. 2020 a las 10:00, jorgeeflorez . (<
> [email protected]>) escribió:
>
>> Hi all,
>> I would like to know some statistics from a repository (a rather large
>> repository):
>> 1. Node count from each node type.
>> 2. Total node count (from user created node types).
>> 3. Total file size (maybe including/excluding version files).
>> 4. How many files are stored for a specific extension.
>> 5. The smallest file stored (and its size), maybe  for a specific
>> extension.
>> 6. The largest file stored (and its size) , maybe  for a specific
>> extension.
>>
>> I think node counts can be known by making a query (e.g. SELECT [name()]
>>  FROM [MyType]), iterating and counting, but that can take some time in my
>> repository and for each node type. Is there another way?
>> I am not sure how would I get file size statistics, maybe with some
>> method from the node/data store?
>>
>> Any help is appreciated :)
>>
>> Best Regards.
>>
>> Jorge
>>
>

Reply via email to