[ 
https://issues.apache.org/jira/browse/OAK-7904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16697298#comment-16697298
 ] 

Tommaso Teofili edited comment on OAK-7904 at 11/23/18 4:01 PM:
----------------------------------------------------------------

attached a first draft patch which enables fetching of {{StatisticsProvider}} 
when it's not possible to use OSGi {{@Rererence}} annotations.
This would enable recording of meters / stats also from inside the query 
engine, e.g. via :
{code}
StatisticsProvider statisticsProvider = 
StaticStatisticsProviderService.getStatisticsProvider();
if (statisticsProvider != null) {
    HistogramStats histogram = statisticsProvider.getHistogram("foo-histogram", 
StatsOptions.METRICS_ONLY);
}  
{code}

[~catholicon], [~tmueller], [~chibulcu] although I know this is a suboptimal 
solution, I cannot think of any other non convoluted one involving passing the 
{{StatisticsProvider}} from {{Oak}} class down the whole stack until the 
{{QueryEngineImpl}} or {{QueryImpl}}, please let me know what you think.


was (Author: teofili):
attached a first draft patch which enables fetching of {{StatisticsProvider}} 
when it's not possible to use OSGi {{@Rererence}} annotations.
This would enable recording of meters / stats also from inside the query 
engine, e.g. via :
{code}
StatisticsProvider statisticsProvider = 
StaticStatisticsProviderService.getStatisticsProvider();
if (statisticsProvider != null) {
    HistogramStats histogram = statisticsProvider.getHistogram("foo-histogram", 
StatsOptions.METRICS_ONLY);
}  
{code}

> Exporting query duration per index metrics with Sling Metrics / DropWizard
> --------------------------------------------------------------------------
>
>                 Key: OAK-7904
>                 URL: https://issues.apache.org/jira/browse/OAK-7904
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: indexing, query
>            Reporter: Paul Chibulcuteanu
>            Priority: Major
>             Fix For: 1.9.10
>
>         Attachments: OAK-7904.0.patch
>
>
> Purpose of this task is to evaluate & create metric which calculates the 
> average duration of query for each index.
> This metric can be later used to evaluate which index(s) need to be optimised.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to