Skip to content

Commit 9e11f4f

Browse files
committed
added metrics to capture append and add metrics
1 parent 3e86316 commit 9e11f4f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

evcache-client/src/main/java/net/spy/memcached/EVCacheMemcachedClient.java

+6
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ public void receivedStatus(OperationStatus val) {
310310
rv.set(val.isSuccess(), val);
311311
appendSuccess = true;
312312
} else {
313+
EVCacheMetricsFactory.getCounter(appName + "-" + serverGroup.getName() + "-AoA-AppendCall-FAIL").increment();
313314
appendSuccess = false;
314315
}
315316
}
@@ -327,6 +328,11 @@ public void receivedStatus(OperationStatus val) {
327328
if (log.isDebugEnabled()) log.debug("AddOrAppend Key (Ad Operation): " + key + "; Status : " + val.getStatusCode().name()
328329
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (System.currentTimeMillis() - operationDuration.getDuration()));
329330
rv.set(val.isSuccess(), val);
331+
if(val.isSuccess()) {
332+
EVCacheMetricsFactory.getCounter(appName + "-" + serverGroup.getName() + "-AoA-AddCall-SUCCESS").increment();
333+
} else {
334+
EVCacheMetricsFactory.getCounter(appName + "-" + serverGroup.getName() + "-AoA-AddCall-FAIL").increment();
335+
}
330336
}
331337

332338
@Override

0 commit comments

Comments
 (0)