diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-09-25 10:28:21 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-09-25 10:28:24 +0000 |
commit | 6189207f8b3fa51e29b903e3322e654d5a06ebdc (patch) | |
tree | 9b8160cfcb25bb0194ee2209feb8666575210556 /vespaclient-container-plugin/src/main | |
parent | ddfd00b72439e8a3cc39b8bca0f445af799e3baa (diff) |
fix lost handler metrics
* since all these classes use a shared FeedContext instance we must make
sure that nobody ever uses NullFeedMetric (except unit tests & VespaFeeder).
Diffstat (limited to 'vespaclient-container-plugin/src/main')
3 files changed, 24 insertions, 11 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/feedhandler/VespaFeedHandlerStatus.java b/vespaclient-container-plugin/src/main/java/com/yahoo/feedhandler/VespaFeedHandlerStatus.java index 8c07ea30312..77d8a6ed37c 100755 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/feedhandler/VespaFeedHandlerStatus.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/feedhandler/VespaFeedHandlerStatus.java @@ -9,6 +9,7 @@ import com.yahoo.container.jdisc.HttpRequest; import com.yahoo.container.jdisc.HttpResponse; import com.yahoo.container.jdisc.ThreadedHttpRequestHandler; import com.yahoo.document.config.DocumentmanagerConfig; +import com.yahoo.jdisc.Metric; import com.yahoo.vespa.config.content.LoadTypeConfig; import com.yahoo.feedapi.FeedContext; import com.yahoo.metrics.MetricManager; @@ -28,9 +29,12 @@ public class VespaFeedHandlerStatus extends ThreadedHttpRequestHandler { DocumentmanagerConfig documentmanagerConfig, SlobroksConfig slobroksConfig, ClusterListConfig clusterListConfig, - Executor executor) { - this(FeedContext.getInstance(feederConfig, loadTypeConfig, documentmanagerConfig, slobroksConfig, - clusterListConfig, new NullFeedMetric()), true, true, executor); + Executor executor, + Metric metric) { + this(FeedContext.getInstance(feederConfig, loadTypeConfig, + documentmanagerConfig, slobroksConfig, + clusterListConfig, metric), + true, true, executor); } VespaFeedHandlerStatus(FeedContext context, boolean doLog, boolean makeSnapshots, Executor executor) { diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java b/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java index 1660ef19e7f..3a5bda776b1 100755 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java @@ -6,7 +6,7 @@ import com.yahoo.cloud.config.ClusterListConfig; import com.yahoo.cloud.config.SlobroksConfig; import com.yahoo.container.jdisc.HttpRequest; import com.yahoo.document.config.DocumentmanagerConfig; -import com.yahoo.feedhandler.NullFeedMetric; +import com.yahoo.jdisc.Metric; import com.yahoo.processing.request.CompoundName; import com.yahoo.vespa.config.content.LoadTypeConfig; import com.yahoo.document.DataType; @@ -199,9 +199,14 @@ public class GetSearcher extends Searcher { LoadTypeConfig loadTypeConfig, DocumentmanagerConfig documentmanagerConfig, SlobroksConfig slobroksConfig, - ClusterListConfig clusterListConfig) throws Exception { - this(FeedContext.getInstance(feederConfig, loadTypeConfig, documentmanagerConfig, slobroksConfig, - clusterListConfig, new NullFeedMetric()), (long)(feederConfig.timeout() * 1000)); + ClusterListConfig clusterListConfig, + Metric metric) + throws Exception + { + this(FeedContext.getInstance(feederConfig, loadTypeConfig, + documentmanagerConfig, slobroksConfig, + clusterListConfig, metric), + (long)(feederConfig.timeout() * 1000)); } GetSearcher(FeedContext context) throws Exception { diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/VisitSearcher.java b/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/VisitSearcher.java index 2f2a10c53ed..a3ac64e78a4 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/VisitSearcher.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/VisitSearcher.java @@ -4,7 +4,6 @@ package com.yahoo.storage.searcher; import com.yahoo.cloud.config.ClusterListConfig; import com.yahoo.cloud.config.SlobroksConfig; import com.yahoo.document.config.DocumentmanagerConfig; -import com.yahoo.feedhandler.NullFeedMetric; import com.yahoo.vespa.config.content.LoadTypeConfig; import com.yahoo.component.ComponentId; import com.yahoo.component.ComponentSpecification; @@ -14,6 +13,7 @@ import com.yahoo.documentapi.*; import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol; import com.yahoo.feedapi.FeedContext; import com.yahoo.feedapi.MessagePropertyProcessor; +import com.yahoo.jdisc.Metric; import com.yahoo.messagebus.StaticThrottlePolicy; import com.yahoo.search.Query; import com.yahoo.search.Result; @@ -37,9 +37,13 @@ public class VisitSearcher extends Searcher { LoadTypeConfig loadTypeConfig, DocumentmanagerConfig documentmanagerConfig, SlobroksConfig slobroksConfig, - ClusterListConfig clusterListConfig) throws Exception { - this(FeedContext.getInstance(feederConfig, loadTypeConfig, documentmanagerConfig, - slobroksConfig, clusterListConfig, new NullFeedMetric())); + ClusterListConfig clusterListConfig, + Metric metric) + throws Exception + { + this(FeedContext.getInstance(feederConfig, loadTypeConfig, + documentmanagerConfig, slobroksConfig, + clusterListConfig, metric)); } VisitSearcher(FeedContext context) throws Exception { |