diff options
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/statistics/StatisticsSearcher.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/statistics/StatisticsSearcher.java b/container-search/src/main/java/com/yahoo/prelude/statistics/StatisticsSearcher.java index 1d1c446f6e1..2f3c066279d 100644 --- a/container-search/src/main/java/com/yahoo/prelude/statistics/StatisticsSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/statistics/StatisticsSearcher.java @@ -72,6 +72,7 @@ public class StatisticsSearcher extends Searcher { private static final String RELEVANCE_AT_1_METRIC = "relevance.at_1"; private static final String RELEVANCE_AT_3_METRIC = "relevance.at_3"; private static final String RELEVANCE_AT_10_METRIC = "relevance.at_10"; + private static final String QUERY_ITEM_COUNT = "query_item_count"; @SuppressWarnings("unused") // all the work is done by the callback private final PeakQpsReporter peakQpsReporter; @@ -264,6 +265,8 @@ public class StatisticsSearcher extends Searcher { addRelevanceMetrics(query, execution, result); + addItemCountMetric(query, metricContext); + return result; } @@ -396,6 +399,10 @@ public class StatisticsSearcher extends Searcher { } } + private void addItemCountMetric(Query query, Metric.Context context) { + metric.set(QUERY_ITEM_COUNT, query.getModel().getQueryTree().getTreeSize(), context); + } + /** * Returns the relative start time from request was received by jdisc */ |