ModeShape/modeshape — pull request #861 by elvisisking (2013-06-20 18:10:40+00:00)
Title: MODE-1719 AS7 subsystem should expose monitoring information via management layer

Added to the JBoss subsystem the ability to gather metrics using the RepositoryStatistics provided by the JcrRepository.

Things seem to be working. I can use the JBoss AS CLI and see the metrics and also see that there is 1 "session-count" and 1 "workspace-count." I have all the metrics defaulting to zero. But would be nice to see/test the other metrics too.

Here are some questions/comments about this implementation:

- I am using JcrRepository.getRepositoryStatistics() to obtain the metrics. I make that call each time an individual metric (value or duration) is requested. I'm not sure making that call is a costly operation or not. I am also defaulting the window to Window.PREVIOUS_60_SECONDS.

- I am using JcrRepository.login() to get the repository metrics to be available. I do that when the MonitorService (a new service) is started. A MonitorService is created for each repository when a repository is added.

- I have not written any tests associated with this new code. Is there a way I can do that?

Thanks!