summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/prelude/statistics
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-10-26 10:29:02 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-10-26 10:29:02 +0200
commitd952e3c77ab632150935856b26b1c711ce2087a1 (patch)
treee9d0c649db34d2035c64d8cb98a31206c4f825c2 /container-search/src/main/java/com/yahoo/prelude/statistics
parentc658aa8303faeed928aec1a05722a1ea62303341 (diff)
Count invalid and missing queries as failed
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/statistics')
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/statistics/StatisticsSearcher.java22
1 files changed, 6 insertions, 16 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 1327e69f82f..241bcf4865a 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
@@ -225,25 +225,15 @@ public class StatisticsSearcher extends Searcher {
}
private void incrErrorCount(Result result, Metric.Context metricContext) {
- //If result is null an exception was thrown further down
- if (result == null) {
- //myStats.incrErrorCount();
- failedQueries.increment();
- metric.add(FAILED_QUERIES_METRIC, 1, metricContext);
- metric.add("error.unhandled_exception", 1, metricContext);
- return;
- }
+ failedQueries.increment();
+ metric.add(FAILED_QUERIES_METRIC, 1, metricContext);
- if (result.hits().getErrorHit().hasOnlyErrorCode(Error.NULL_QUERY.code)) {
+ if (result == null) // the chain threw an exception
+ metric.add("error.unhandled_exception", 1, metricContext);
+ else if (result.hits().getErrorHit().hasOnlyErrorCode(Error.NULL_QUERY.code))
nullQueries.increment();
- return;
- } else if (result.hits().getErrorHit().hasOnlyErrorCode(Error.ILLEGAL_QUERY.code)) {
+ else if (result.hits().getErrorHit().hasOnlyErrorCode(Error.ILLEGAL_QUERY.code))
illegalQueries.increment();
- return;
- }
- //myStats.incrErrorCount();
- failedQueries.increment();
- metric.add(FAILED_QUERIES_METRIC, 1, metricContext);
}
/**