Hi, I'm not quite sure what is the best approach. I think it should not be a static field, and not a singleton. There should be one instance per repository I guess. Maybe you want to have a look at where WhiteboardUtils.registerMBean is called, and then implement it in a similar way? See also MongoNodeStoreService.registerJMXBeans. I'm not too familiar with how this works however.
Regards, Thomas On 12/10/13 2:03 PM, "Matei Stefan Chiperi" <[email protected]> wrote: >Hello, > >I¹d like to work on the OAK-1217 [1] issue, so we can have queries >statistics in Oak, too. > >My first attempt would be to replicate the approach existing in >Jackrabbit: >- declare a StatManager which logs each executed query and its response >time. >- declare a QueryStatManagerMBean which would provide access to the >statistics gathered by the StatManager. > >I have one problem though, the StatManager was defined in the >RepositoryContext in Jackrabbit. >As there is no RepositoryContext in Oak, my question would be where would >be the best place to define such an object. >My idea would be to define it in the QueryEngineImpl, and it would either >be a static field or the StatManager class to be a Singleton. > >Is there any more suitable place / approach? > >Thanks! >Matei
