diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-11-25 15:01:30 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-11-25 15:01:30 +0100 |
commit | 2b863cce83fd5ed0f99d82d4dbe6f84cdd1ed8fe (patch) | |
tree | e8bf28e7fe16941d3beab7e844d4f16167cf033d /vespaclient-container-plugin/src/main | |
parent | 53599cea91b8adad824a100b3ff42a5b84a29368 (diff) |
Rename metric to 'httpapi_condition_not_met'
Diffstat (limited to 'vespaclient-container-plugin/src/main')
2 files changed, 5 insertions, 2 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java index 3faafd7b2e5..50f79c0a828 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java @@ -12,6 +12,7 @@ import com.yahoo.messagebus.Trace; import com.yahoo.vespa.http.client.core.ErrorCode; import com.yahoo.vespa.http.client.core.OperationStatus; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -25,10 +26,12 @@ public class FeedReplyReader implements ReplyHandler { private static final Logger log = Logger.getLogger(FeedReplyReader.class.getName()); private final Metric metric; private final DocumentApiMetrics metricsHelper; + private final Metric.Context testAndSetMetricCtx; public FeedReplyReader(Metric metric, DocumentApiMetrics metricsHelper) { this.metric = metric; this.metricsHelper = metricsHelper; + this.testAndSetMetricCtx = metric.createContext(Map.of("operationType", "testAndSet")); } @Override @@ -52,7 +55,7 @@ public class FeedReplyReader implements ReplyHandler { metricsHelper.reportSuccessful(type, latencyInSeconds); metric.add(MetricNames.SUCCEEDED, 1, null); if (!conditionMet) - metric.add(MetricNames.TEST_AND_SET_CONDITION_NOT_MET, 1, null); + metric.add(MetricNames.CONDITION_NOT_MET, 1, testAndSetMetricCtx); enqueue(context, "Document processed.", ErrorCode.OK, !conditionMet, reply.getTrace()); } } diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/MetricNames.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/MetricNames.java index 4b49e3594f8..6ded410ff68 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/MetricNames.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/MetricNames.java @@ -18,7 +18,7 @@ public final class MetricNames { public static final String OPERATIONS_PER_SEC = PREFIX + "ops_per_sec"; public static final String LATENCY = PREFIX + "latency"; public static final String FAILED = PREFIX + "failed"; - public static final String TEST_AND_SET_CONDITION_NOT_MET = PREFIX + "test_and_set_condition_not_met"; + public static final String CONDITION_NOT_MET = PREFIX + "condition_not_met"; public static final String PARSE_ERROR = PREFIX + "parse_error"; public static final String SUCCEEDED = PREFIX + "succeeded"; public static final String PENDING = PREFIX + "pending"; |