[
https://issues.apache.org/jira/browse/MARMOTTA-408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13917518#comment-13917518
]
Rajika Kumarasiri commented on MARMOTTA-408:
--------------------------------------------
hello,
I got the proposed POC working. Please find the attached patch and the
screenshot.
The screenshot shows how I exposed the OS and JDK run-time information(similar
to System->Statistics->System ) using a MBean from the newly developed JMX
infrastructure.
The classes;
a). org.apache.marmotta.platform.core.api.jmx.JMXService
b). org.apache.marmotta.platform.core.services.jmx.JMXServiceImpl
c). org.apache.marmotta.platform.core.services.jmx.JMXRMIRegistryController
d). org.apache.marmotta.platform.core.services.jmx.JMXMBeansRegister
e). org.apache.marmotta.platform.core.services.jmx.JMXAdapter
are responsible for #1 in the jira. The mentioned MBeanRegister API is defined
in JMXMBeansRegister (d)). It has the APIs to register and unregister the
MBeans. The other classes basically create a JMX connector and starts it with
the platform. I consumed the SystemStartupEvent to start the JMX CDI service.
When the JMX service started you will see a log entry similar to below.
11:19:49.001 INFO o.a.m.p.core.services.jmx.JMXAdapter - Management using JMX
available from 'service:jmx:rmi:///jndi/rmi://localhost:15000/marmotta'.
The interface and class;
a). org.apache.marmotta.platform.core.services.jmx.SystemStatisticsMBean
b). org.apache.marmotta.platform.core.services.jmx.SystemStatistics
are an example for #2. They collects the stats about the OS/JDK run time data
and register them into #1 using MBeans so that we can view that statistics
using JConsole(or any other JMX client). This is what can be seen in the screen
shot. I just implemented this logic inside
org.apache.marmotta.platform.core.services.jmx.JMXServiceImpl itself but it
should be implemented in each place where those stats will be collected (for
example
org.apache.marmotta.platform.core.services.statistics.system.SystemStatisticsModule).
Now the next step is to identify various places, components or modules across
the platform and other places and replace them with relevant MBeans and
register them with the MBean server similar to #2 above. #1 also need to
improve so that other jmx parameters can be configured(for example SSL
connections).
Do you think I am heading in the correct direction ? I would like to start
writing my proposal based on this information once I compiled a list of places
to have new MBeans to collect respective statistics. I am familiar with JUnit
and each of this new feature will be covered with a JUnit test case.
Please let me know your feedback or any comment.
Thank you.
> Use MBeans / JMX for monitoring and statistics
> -----------------------------------------------
>
> Key: MARMOTTA-408
> URL: https://issues.apache.org/jira/browse/MARMOTTA-408
> Project: Marmotta
> Issue Type: Improvement
> Components: Platform
> Reporter: Sebastian Schaffert
> Labels: gsoc2014, java, jmx
>
> We should use JMX for monitoring different aspects of the Marmotta system,
> e.g. the caching statistics. This should replace the existing
> StatisticsService, providing a new infrastructure to store and push via JMX
> different parameters, allowing to monitor Marmotta from any of the available
> JMX tools.
--
This message was sent by Atlassian JIRA
(v6.2#6252)