Hi, I tried the RepositoryImpl approach and I log a query in the StatManager whenever the org.apache.jackrabbit.oak.jcr.query.QueryManagerImpl.executeQuery method is hit.
Everything is nice, but the problem is that I don’t see any query being resolved by calling the QueryManager’s executeQuery method. Instead, the QueryEngineImpl.executeQuery is called directly. (For instance, in the org.apache.jackrabbit.security.user.UserProvider.getAuthorizableByPrincipal method). I would log the query duration in the QueryEngineImpl, but I can’t see a clean way of accessing a RepositoryImpl reference, so I can get the StatManager instance. Do you have any suggestions? Thanks, Matei On 12/10/13, 4:17 PM, "Matei Stefan Chiperi" <[email protected]> wrote: >Hi Thomas, > >Thanks for the feedback. Indeed, I saw the Whiteboard approach for >registering the means. >I would use this approach, and since it would make sense to have a >StatManager for each repository, >I’d add it as a member of the RepositoryImpl class. > >Thanks, >Matei > >On 12/10/13, 3:35 PM, "Thomas Mueller" <[email protected]> wrote: > >>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 >> >
