Permalink
Browse files

changed checkout record code to make sure timeouts are recorded

  • Loading branch information...
zhongjiewu committed Jun 13, 2012
1 parent f527daa commit be224413bb0c53a4339c72f9c5c0c09687034ac3
Showing with 9 additions and 8 deletions.
  1. +9 −8 src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorPool.java
@@ -133,20 +133,21 @@ public SocketStore create(String storeName,
*/
public ClientRequestExecutor checkout(SocketDestination destination) {
+ // time checkout
+ long start = System.nanoTime();
+ ClientRequestExecutor clientRequestExecutor;
try {
- // time checkout
- long start = System.nanoTime();
- ClientRequestExecutor clientRequestExecutor = pool.checkout(destination);
+ clientRequestExecutor = pool.checkout(destination);
+ } catch(Exception e) {
+ throw new UnreachableStoreException("Failure while checking out socket for "
+ + destination + ": ", e);
+ } finally {
long end = System.nanoTime();
if(stats != null) {
stats.recordCheckoutTimeUs(destination, (end - start) / Time.NS_PER_US);
}
-
- return clientRequestExecutor;
- } catch(Exception e) {
- throw new UnreachableStoreException("Failure while checking out socket for "
- + destination + ": ", e);
}
+ return clientRequestExecutor;
}
/**

0 comments on commit be22441

Please sign in to comment.