PeerGroup: Log shutdown times.
@@ -1082,6 +1082,7 @@ public class PeerGroup implements TransactionBroadcaster {
public void run() {
try {
log.info("Stopping ...");
+ Stopwatch watch = Stopwatch.createStarted();
// Blocking close of all sockets.
channels.stopAsync();
channels.awaitTerminated();
@@ -1089,7 +1090,7 @@ public class PeerGroup implements TransactionBroadcaster {
peerDiscovery.shutdown();
}
vRunning = false;
- log.info("Stopped.");
+ log.info("Stopped, took {}.", watch);
} catch (Throwable e) {
log.error("Exception when shutting down", e); // The executor swallows exceptions :(
}
@@ -1102,9 +1103,11 @@ public class PeerGroup implements TransactionBroadcaster {
/** Does a blocking stop */
public void stop() {
try {
+ Stopwatch watch = Stopwatch.createStarted();
stopAsync();
log.info("Awaiting PeerGroup shutdown ...");
executor.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
+ log.info("... took {}", watch);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
