From a3e3a5af779d42af8b30f74d2cb475b693c07db7 Mon Sep 17 00:00:00 2001 From: valerijf Date: Thu, 11 May 2017 14:47:39 +0200 Subject: Arch. review fixes --- .../main/java/com/yahoo/document/restapi/OperationHandlerImpl.java | 2 +- .../com/yahoo/documentapi/metrics/DocumentApiMetricsHelper.java | 4 ++-- .../java/com/yahoo/documentapi/metrics/DocumentOperationStatus.java | 4 ++-- .../src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'vespaclient-container-plugin/src/main/java/com/yahoo') 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 errorCodes = MessageBusAsyncSession.getErrorCodes(reply); - //metricsHelper.reportFailure(DocumentOperationType.fromMessage(reply.getMessage()), - // DocumentOperationStatus.fromMessageBusErrorCodes(errorCodes)); + Set 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()); -- cgit v1.2.3