diff options
5 files changed, 9 insertions, 10 deletions
diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java index 793e0ed73c0..845a04490b5 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java @@ -198,8 +198,7 @@ public class MessageBusAsyncSession implements MessageBusSession, AsyncSession { return errors.toString(); } - static Set<Integer> - getErrorCodes(Reply reply) { + public static Set<Integer> getErrorCodes(Reply reply) { Set<Integer> errorCodes = new HashSet<>(); for (int i = 0; i < reply.getNumErrors(); ++i) { errorCodes.add(reply.getError(i).getCode()); diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java index f7638a45168..218d1779bb5 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java @@ -73,7 +73,7 @@ public class OperationHandlerImpl implements OperationHandler { this.documentAccess = documentAccess; this.clusterEnumerator = clusterEnumerator; syncSessions = new ConcurrentResourcePool<>(new SyncSessionFactory(documentAccess)); - metricsHelper = new DocumentApiMetricsHelper(metricReceiver, "/document/v1"); + metricsHelper = new DocumentApiMetricsHelper(metricReceiver, "documentV1"); } @Override diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentApiMetricsHelper.java b/vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentApiMetricsHelper.java index a082f7dba8a..154f473630e 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentApiMetricsHelper.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentApiMetricsHelper.java @@ -30,8 +30,8 @@ public class DocumentApiMetricsHelper { } } - feeds = metricReceiver.declareCounter("feed_operations"); - feedLatency = metricReceiver.declareGauge("feed_latency"); + feeds = metricReceiver.declareCounter("feed.operations"); + feedLatency = metricReceiver.declareGauge("feed.latency"); } public void reportSuccessful(DocumentOperationType documentOperationType, double latency) { diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentOperationStatus.java b/vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentOperationStatus.java index 3ed1f42ca14..cdbaf645b6e 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentOperationStatus.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentOperationStatus.java @@ -9,7 +9,7 @@ import java.util.Set; * @author freva */ public enum DocumentOperationStatus { - OK, CLIENT_ERROR, SERVER_ERROR; + OK, REQUEST_ERROR, SERVER_ERROR; public static DocumentOperationStatus fromHttpStatusCode(int httpStatus) { switch (httpStatus / 100) { @@ -17,7 +17,7 @@ public enum DocumentOperationStatus { return OK; case 4: - return CLIENT_ERROR; + return REQUEST_ERROR; case 5: return SERVER_ERROR; 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 3dd75e3d7eb..eccc1cb17e7 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 @@ -44,9 +44,9 @@ public class FeedReplyReader implements ReplyHandler { metric.set(MetricNames.LATENCY, latency, null); if (reply.hasErrors()) { - //Set<Integer> errorCodes = MessageBusAsyncSession.getErrorCodes(reply); - //metricsHelper.reportFailure(DocumentOperationType.fromMessage(reply.getMessage()), - // DocumentOperationStatus.fromMessageBusErrorCodes(errorCodes)); + Set<Integer> errorCodes = MessageBusAsyncSession.getErrorCodes(reply); + metricsHelper.reportFailure(DocumentOperationType.fromMessage(reply.getMessage()), + DocumentOperationStatus.fromMessageBusErrorCodes(errorCodes)); metric.add(MetricNames.FAILED, 1, null); enqueue(context, reply.getError(0).getMessage(), ErrorCode.ERROR, reply.getError(0).getCode() == DocumentProtocol.ERROR_TEST_AND_SET_CONDITION_FAILED, reply.getTrace()); |