Skip to content

Commit

Permalink
changed checkout record code to make sure timeouts are recorded
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongjiewu committed Jun 19, 2012
1 parent f527daa commit be22441
Showing 1 changed file with 9 additions and 8 deletions.
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit be22441

Please sign in to comment.