summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorvalerijf <valerijf@yahoo-inc.com>2017-05-11 14:47:39 +0200
committervalerijf <valerijf@yahoo-inc.com>2017-05-11 14:47:39 +0200
commita3e3a5af779d42af8b30f74d2cb475b693c07db7 (patch)
tree4b681ce44074333e39704d2902c763b7df3fc5e6 /vespaclient-container-plugin
parent7c2848272593fd4dce5220bb28b17510ed40904f (diff)
Arch. review fixes
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java2
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentApiMetricsHelper.java4
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/documentapi/metrics/DocumentOperationStatus.java4
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java6
4 files changed, 8 insertions, 8 deletions
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());