diff options
author | Ola Aunrønning <olaa@verizonmedia.com> | 2021-11-26 12:11:56 +0100 |
---|---|---|
committer | Ola Aunrønning <olaa@verizonmedia.com> | 2021-11-26 12:11:56 +0100 |
commit | 5d952b4e6695a6cb8d4e6473806e51118b7fb200 (patch) | |
tree | 995a0d337f61e748e8d3ed1766b8b819fac327ba /container-search | |
parent | 20f3d55bd2e1d89e75a8cae54ffed165273dcd98 (diff) |
Adds query_item_count metric
Diffstat (limited to 'container-search')
-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 */ |