Skip to content

Commit

Permalink
Changed default failure mode from Retry to cancel. Fixed metric name.
Browse files Browse the repository at this point in the history
  • Loading branch information
smadappa committed Aug 18, 2016
1 parent c5bcd87 commit 1805770
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class BaseConnectionFactory extends BinaryConnectionFactory {
this.serverGroup = serverGroup;
this.poolManager = poolManager;
this.startTime = System.currentTimeMillis();
this.failureMode = EVCacheConfig.getInstance().getChainedStringProperty(this.serverGroup.getName() + ".failure.mode", appName + ".failure.mode", "Cancel");
this.failureMode = EVCacheConfig.getInstance().getChainedStringProperty(this.serverGroup.getName() + ".failure.mode", appName + ".failure.mode", "Retry");
this.name = appName + "-" + serverGroup.getName() + "-" + id;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,24 +453,21 @@ public void receivedStatus(OperationStatus val) {
+ "; Message : " + val.getMessage() + "; Elapsed Time - " + (System.currentTimeMillis() - operationDuration.getDuration()));

if (val.getStatusCode().equals(StatusCode.SUCCESS)) {
//EVCacheMetricsFactory.getCounter(appName + "-" + serverGroup.getName() + "-" + operationStr + "Call-SUCCESS").increment();
EVCacheMetricsFactory.increment(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Call-SUCCESS");
EVCacheMetricsFactory.increment(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Operation-SUCCESS");
} else if (val.getStatusCode().equals(StatusCode.TIMEDOUT)) {
Tag tag = null;
final MemcachedNode node = getEVCacheNode(key);
if (node.getSocketAddress() instanceof InetSocketAddress) {
tag = new BasicTag("HOST", ((InetSocketAddress) node.getSocketAddress()).getHostName());
}
EVCacheMetricsFactory.getCounter(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Call-TIMEDOUT", tag).increment();
//EVCacheMetricsFactory.getCounter(appName + "-" + serverGroup.getName() + "-" + operationStr + "Call-TIMEDOUT", tag).increment();
EVCacheMetricsFactory.getCounter(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Operation-TIMEDOUT", tag).increment();
} else {
Tag tag = null;
final MemcachedNode node = getEVCacheNode(key);
if (node.getSocketAddress() instanceof InetSocketAddress) {
tag = new BasicTag("HOST", ((InetSocketAddress) node.getSocketAddress()).getHostName());
}
EVCacheMetricsFactory.getCounter(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Call-" + val.getStatusCode().name(), tag).increment();
//EVCacheMetricsFactory.getCounter(appName + "-" + serverGroup.getName() + "-" + operationStr + "Call-" + val.getStatusCode().name(), tag).increment();
EVCacheMetricsFactory.getCounter(appName, null, serverGroup.getName(), appName + "-" + operationStr + "Operation-" + val.getStatusCode().name(), tag).increment();
}
rv.set(val.isSuccess(), val);
}
Expand Down

0 comments on commit 1805770

Please sign in to comment.